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

relative_path should not be auto-generated for location types other than dataregistry and dummy #165

Open
JoanneBogart opened this issue Nov 8, 2024 · 1 comment
Assignees

Comments

@JoanneBogart
Copy link
Collaborator

JoanneBogart commented Nov 8, 2024

There is this code in register:

 # If `relative_path` not passed, automatically generate it
    if kwargs_dict["relative_path"] is None:
        kwargs_dict["relative_path"] = _relpath_from_name(
            name, kwargs_dict["version_string"], kwargs_dict["old_location"]
        )

But for location types external and meta_only there is no meaningful relative path. I would say the most natural value in that case is None. Is there any reason not to modify the above to

# If `relative_path` not passed, automatically generate it
      if kwargs_dict["relative_path"] is None and kwargs_dict["location_type"] in ["dataregistry", "dummy"]:

and so forth

@JoanneBogart
Copy link
Collaborator Author

JoanneBogart commented Nov 8, 2024

It turns out there is: currently we have a non-null constraint for relative_path.
Probably we should eliminate that constraint, but if so, I'd like to do it in-place for the schemas lsst_desc_production, lsst_desc_working and the corresponding tutorial schemas.

The other alternative would be to use some other sentinal value for meta_only and external. Currently for meta_only location type I'm also setting relative_path to meta_only, but that's probably not a good idea since it collides with a legitimate relative path. A better choice might be something like ?None? That is, include a character or characters not normally allowed for relative_path.

This is what I've done for now. That is, for all the catalog entries with location type meta_only I've changed relative_path to ?None? This will require a small change to the code to not do validity-checking on the relative_path field in case location type is meta_only or external (or, maybe better, set the special values itself).

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

No branches or pull requests

2 participants