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

Update the api_version check to allow 2022.12 and warn on 2021.12 #88

Merged
merged 2 commits into from
Mar 7, 2024

Conversation

asmeurer
Copy link
Member

@asmeurer asmeurer commented Feb 9, 2024

Not sure if a warning is the best option here. The returned namespace is 2022.12 compliant, and that is also 2021.12 compliant (except for a few minor things). I don't think it's worth trying to support both, unless someone has a real use-case.

Not sure if a warning is the best option here. The returned namespace is
2022.12 compliant, and that is also 2021.12 compliant (except for a few minor
things). I don't think it's worth trying to support both, unless someone has a
real use-case.
@rgommers
Copy link
Member

rgommers commented Feb 9, 2024

I'd leave out the warning and just return the superset of 2022.12

if api_version == '2021.12':
warnings.warn("The 2021.12 version of the array API specification was requested but the returned namespace is actually version 2022.12")
if api_version is not None and api_version != '2022.12':
raise ValueError("Only the 2022.12 version of the array API specification is currently supported")
Copy link
Member

Choose a reason for hiding this comment

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

The text of the error isn't right, no? Because 2022.12 and 2021.12 are supported


Can we somehow re-do the if statements? I think something like the below would be easier to read and implement the behaviour Ralf suggested (no warning, just return subset)

if api_version is not in ('2021.12', '2022.12', None):
    raise ValueError(f"The specified Array API version '{api_version}' is not supported.")

WDYT?

@asmeurer asmeurer merged commit 5316b07 into data-apis:main Mar 7, 2024
20 of 27 checks passed
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.

3 participants