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

There should be a way to silence the DeprecationWarning #267

Open
greglucas opened this issue Jun 7, 2024 · 0 comments
Open

There should be a way to silence the DeprecationWarning #267

greglucas opened this issue Jun 7, 2024 · 0 comments

Comments

@greglucas
Copy link

We are currently getting these deprecation warnings:

DeprecationWarning: datetime64_to_cdftt2000 will eventually be phased out. Instead, datetime64 types will automatically be converted into a CDF time type. If you do not wish datetime64 arrays to be converted, cast them to a different type prior to calling xarray_to_cdf()

even when leaving out the keyword argument in the call. This is because there is a default keyword argument still in the signature which makes this case always hit.

if datetime64_to_cdftt2000:
warn(
"datetime64_to_cdftt2000 will eventually be phased out. Instead, datetime64 types will automatically be converted into a CDF time type. If you do not wish datetime64 arrays to be converted, cast them to a different type prior to calling xarray_to_cdf()",
DeprecationWarning,
stacklevel=2,
)

I think you might be able to add a **kwargs catch-all here for the deprecation warning and see if datetime64_to_cdftt2000 is in kwargs and issue the deprecation warning then.

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

1 participant