-
Notifications
You must be signed in to change notification settings - Fork 9
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
Add passthrough for storage cls args #106
base: main
Are you sure you want to change the base?
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #106 +/- ##
==========================================
+ Coverage 96.46% 96.48% +0.02%
==========================================
Files 15 15
Lines 509 512 +3
==========================================
+ Hits 491 494 +3
Misses 18 18 ☔ View full report in Codecov by Sentry. |
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 have one minor gripe but it is ultimately aesthetic. Feel free to just hit 'ready for review' again if you think I'm wrong!
target_cls_args_str = ", ".join( | ||
f"{k}={v}" for k, v in self.pangeo_forge_target_class_args.items() | ||
) | ||
return base + (f", {target_cls_args_str}" if target_cls_args_str else "") + ")" |
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 should be equivalent and a bit terser/easier to read: f"{base}, {target_cls_args_str})"
(I think join here should produce "" if no iterations happen from items()
, so the check is not necessary)
self.fsspec_class(**self.fsspec_args), | ||
root_path=self.root_path.format(job_name=job_name), | ||
fsspec_kwargs=self.fsspec_args, | ||
**self.pangeo_forge_target_class_args, |
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.
Might be good to disambiguate the intents of pangeo_forge_target_class_args
and fsspec_args
for more information, see https://pre-commit.ci
pangeo-forge/pangeo-forge-recipes#630 introduces the possibility that storage classes could take args.
This PR adds the ability to passthrough such args.