-
Notifications
You must be signed in to change notification settings - Fork 1k
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
More defensive access of extra props in filesources #17445
More defensive access of extra props in filesources #17445
Conversation
That doesn't look right, FileProps probably needs some work. |
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.
Thanks @nuwang!
I'm not sure why adding an extra attr to FilesSourceProperties
caused the existing one not to be present when unset? But assuming extra_props
is still set properly when it should be, this solution works for me.
lib/galaxy/files/sources/__init__.py
Outdated
|
||
# Property overrides for values initially configured through the constructor. For example | ||
# the HTTPFilesSource passes in additional http_headers through these properties, which | ||
# are merged with constructor defined http_headers. The interpretation of these properties | ||
# are filesystem specific. | ||
extra_props: Optional[FilesSourceProperties] | ||
extra_props: Optional[FilesSourceProperties] = {} |
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.
I think this is fine if you make the class a dataclass ... which may have been the intention from the start ?
Otherwise it's error prone to have this be a class var.
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.
Good point. fixed.
You can use |
Cool thanks! Should we target a release branch (23.1?) since it is a fix? |
c54f5bb
to
6a3575d
Compare
6a3575d
to
a644028
Compare
I've retargeted 23.1, but it looks like the writable property was introduced in 23.2. Should I target that instead? |
I think this is fine as a fix |
a644028
to
4a47a43
Compare
Co-authored-by: Marius van den Beek <[email protected]>
4a47a43
to
c7a5e4f
Compare
This PR was merged without a "kind/" label, please correct. |
Based on bug and solution described in: #17442
How to test the changes?
(Select all options that apply)
License