Skip to content

There should be a way to silence the DeprecationWarning #267

@greglucas

Description

@greglucas

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.
https://github.com/MAVENSDC/cdflib/blob/88ba11e8613cefe9f35bf950e21b6ba276ee9693/cdflib/xarray/xarray_to_cdf.py#L1003-L1008

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.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions