chore: use more robust dtype comparisons, use Narwhals stable API in tests #3670
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Since Narwhals 1.9.0 (release last month),
nw.Datetime
hastime_unit
andtime_zone
metadata, which means thathash(nw.Datetime)
has changed.This change only affects the main Narwhals namespace - the
narwhals.stable.v1
namespace (which you're using 🙌 ) is unaffectedThe fact that having
narwhals.stable.v1
allowed us to make this change without it affecting any users is a pretty good feeling 😄I've rewritten the dtype comparison from
to
so that it will also work in the same way if and when you decide to move to
narwhals.stable.v2
(when we get there). There'll be no obligation to perform such a move of course, we'll keepstable.v1
working as-is, so either way, there's no impact on usersSee the second bullet point at https://narwhals-dev.github.io/narwhals/backcompat/#after-stablev1 for more context