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

Metadata: Check on typing for client mode #6490 #6579

Merged
merged 1 commit into from Mar 19, 2024

Conversation

voetberg
Copy link
Contributor

No description provided.

@bari12
Copy link
Member

bari12 commented Mar 19, 2024

Merging it like this; I am just wondering in general if we should do it like this or park these types in an actual (client accessible) type module and not hide it behind if TYPE_CHECKING.

@bari12 bari12 merged commit b4fddc9 into rucio:master Mar 19, 2024
26 checks passed
@dchristidis dchristidis linked an issue Mar 19, 2024 that may be closed by this pull request
@dchristidis
Copy link
Contributor

Upon closer inspection, the use of KeyType (and anything in constants.py) was wrong. Instances of Enum are not JSON-serialisable, so they can’t be used. The correct hint would have been Literal['ALL', 'COLLECTION', …].

So we don’t have to consider how to import them because we shouldn’t in the first place.

@bari12
Copy link
Member

bari12 commented Mar 19, 2024

Let's change this again then in a following minor release.
Though adding the Literals there also seems error-prone, since we would have to manually keep them in sync with the Enums (In case we keep them and do not change these as well). But my feeling is that we need to have stricter rules there between types used on the client side, types used in the core and types used in the database layer.

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.

Regression from #6490
4 participants