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
Object.get_or_create_by_full_path() #331
Conversation
except KeyError as err: | ||
if name in valid_dataset_attrs and self.is_dataset: | ||
return getattr( | ||
Dataset(self.dataset_id, client=self._client), name) |
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.
why not getattr(self.dataset, name)
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.
we don't need to do the lookup to get the Dataset object in most cases. Wanted to avoid making the GET request if possible, which is why I used the instance.refresh() logic within those methods that needed them
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.
but then why not just not do the lookup in def dataset
?
Allows creating nested paths on the fly, which currently requires way too many lines of code. Takes the existing Dataset.get_or_create_by_full_path() and moves and upgrades it.
Also closes #326
Also closes #287