-
Notifications
You must be signed in to change notification settings - Fork 308
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
Fix: order_by to respect alt #1093
base: master
Are you sure you want to change the base?
Conversation
@@ -1078,7 +1078,7 @@ def get_order_by(self): | |||
"""Returns the order that should be used.""" | |||
if self._order_by is not None: | |||
return self._order_by | |||
base_record = self.pad.get(self.path) | |||
base_record = self.pad.get(self.path, alt=self.alt) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like, in this case, we are interested only in base_record.datamodel
. The datamodel does not depend on any of the record's .lr
files (regardless of alt). Perhaps we should figure out a way that we end up only declaring a dependency on the datamodel .ini
file (and and .ini
files of datamodels from which it inherits)?
More investigation is probably required to determine whether such an optimization would buy us much (in terms of reducing unnecessary recorded dependencies, and thus reducing unnecessary rebuilds).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps this is related to part of PR #1007, where dependency tracking is done in Record.getitem.
Moving dependency tracking to attribute accessors (of both Records and DataModels) rather than recording the dependency upon record traversal would fix this...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Currently this is an issue for all queries with non-default alt. self.pad.get
will access the primary alt in that case and record a dependency. I would be happy if, in this case, the datamodel could be accessed without requesting the record and thus avoid a dependency. But for the time being (if an actual fix will take too long) I would appreciate if the alt would be set as a hotfix. This at least prevents unnecessary rebuilds of alternatives if a primary alt page changes.
And dependency tracking via attributes would be superb. There is another issue from 2016 I think where this was proposed. So dependency tracking could finally be applied to individual fields rather than files.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And dependency tracking via attributes would be superb. There is another issue from 2016 I think where this was proposed. So dependency tracking could finally be applied to individual fields rather than files.
Yes, that would be nice, but is probably a lot of work, and is not quite what I'm referring to.
My point is that just because a record is fetched (via Pad.get
) during the building of an artifact, that does not mean, necessarily, that that artifact depends on that record's source files. It might be better to defer the recording of the dependency until such time as one of the record's fields is accessed, since that does imply a dependency on the source file.
I've seen in some release notes that this may have been fixed? Should I close the PR? |
Add missing alt in pad query.
Issue(s) Resolved
Fixes #1092
Description of Changes