Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't create a search/pulldata database when pulldata is used over an Entity List #6471

Open
lognaturel opened this issue Oct 23, 2024 · 3 comments

Comments

@lognaturel
Copy link
Member

lognaturel commented Oct 23, 2024

Following #6451, pulldata over an Entity List uses the local Entity List database. However, the corresponding search/pulldata database is still being created. This increases form open time for users and leads to side effects like #6461

Currently search() does not use the Entity List database so knowing that a source CSV is for an Entity List is not a sufficient signal to skip search/pulldata database creation.

This could be addressed as part of #6454 or on its own.

@seadowg
Copy link
Member

seadowg commented Nov 13, 2024

I'm thinking we should fix this by skipping the creation of the dynamic preload data DB if a form meets the follow two conditions:

  • Does not include search
  • If the uses pulldata, it's only on entity lists

The big change we'll need to make for that is to persist the "flag" that an instance (media file) is an entity list so that can be determined when parsing a form. There are a lot of other reasons that storing details about media files could be useful though, so I think that's a good change to make here.

Very related to this is how we then deal with search which, as @lognaturel points out, does not currently support local entities. I'm thinking we can approach it like this:

@lognaturel what are your thoughts on this plan? I think it's good to have a long term plan so we know the context surrounding fixing this issue.

@lognaturel
Copy link
Member Author

The short-term plan sounds good and I agree that we will need to know whether a form attachment is an Entity List at a time other than download for other reasons, most notably for #6425. I think that issue is higher priority than this one so maybe it can drive out storing that state.

Introduce a new XLSForm sugar to eventually replace search that pyxform translates to a normal instance('blah)...` expression

I think we already have this: select_one_from_file with a choice filter. And I think it has largely replaced search already because it's so much more comfortable to use. search is much less common than pulldata.

@seadowg
Copy link
Member

seadowg commented Nov 14, 2024

The short-term plan sounds good and I agree that we will need to know whether a form attachment is an Entity List at a time other than download for other reasons, most notably for #6425. I think that issue is higher priority than this one so maybe it can drive out storing that state.

Agreed!

I think we already have this: select_one_from_file with a choice filter. And I think it has largely replaced search already because it's so much more comfortable to use. search is much less common than pulldata.

Great point! I was forgetting that choice_filter already removes the need to deal with instance('blah')/root/item. There are other places where you do need to resort to that syntax, but search wouldn't help you there anyway.

What are your thoughts on deprecating search?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: not ready
Development

No branches or pull requests

2 participants