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

DM-43431: In SasquatchDatastore allow namespace and extra fields to come from environment #228

Merged
merged 3 commits into from Mar 22, 2024

Conversation

timj
Copy link
Member

@timj timj commented Mar 21, 2024

No description provided.

@timj timj requested a review from kfindeisen March 21, 2024 22:20
@timj timj force-pushed the tickets/DM-43431 branch 2 times, most recently from e26fb93 to f3f4772 Compare March 21, 2024 22:38
Copy link
Member

@kfindeisen kfindeisen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mostly just documentation changes.

However, I do have one extra request: can you update the IDENTIFIER_KEYS constant in _dispatcher.py to include group and day_obs? It seems to have been overlooked when they were implemented.

@@ -80,6 +81,9 @@ class SasquatchDatastore(GenericBaseDatastore):
namespace: str
"""The namespace in Sasquatch where the uploaded metrics will be
dispatched.

Defaults to the value obtained from the ``$DAF_BUTLER_SASQUATCH_NAMESPACE``
environment variable and "lsst.dm" if no environment variable is defined.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The wording here is a bit confusing, assuming I understand correctly that these fields can all be set directly in config. Maybe:

Suggested change
environment variable and "lsst.dm" if no environment variable is defined.
Overridden by the ``$DAF_BUTLER_SASQUATCH_NAMESPACE`` environment variable
if it is defined. Defaults to "lsst.dm".

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this have an explicit default like defaultConfigFile does?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry. I don't know what you mean. The default is lsst.dm.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

__init__ assigns "lsst.dm" if nothing supersedes that. I meant "should something be assigned to namespace here, where it's declared?"

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah. Okay. We could do that. Generally the class properties are there for docstrings and I'm not sure why Nate didn't set the default there instead, although a class property and an instance property can get confusing.

@timj timj force-pushed the tickets/DM-43431 branch 2 times, most recently from 9eaf31e to a4b9197 Compare March 21, 2024 23:49
@timj
Copy link
Member Author

timj commented Mar 21, 2024

@kfindeisen please take another look. Completely rewritten. Thanks for the comments.

Copy link
Member

@kfindeisen kfindeisen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, looks clear.

Namespace from environ overrides that from config.
The fields can come from configuration and the environment,
with the environment taking priority.
These are new dimensions that will appear in repos soon.
@timj timj merged commit df12eed into main Mar 22, 2024
8 checks passed
@timj timj deleted the tickets/DM-43431 branch March 22, 2024 05:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants