Skip to content

docs: Add warning for unsupported time units in pandas pre v2 #3007

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

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

benrutter
Copy link
Contributor

What type of PR is this? (check all applicable)

  • πŸ’Ύ Refactor
  • [ish] ✨ Feature
  • πŸ› Bug Fix
  • πŸ”§ Optimization
  • πŸ“ Documentation
  • βœ… Test
  • 🐳 Other

Related issues

Checklist

  • Code follows style guide (ruff)
  • [-] Tests added (this happens within a pragma no cover block - I'm happy to take off the no-cover and add a test, but I think it potentially could require a pre-v2 pandas tests, or some clever patching?)
  • Documented the changes

If you have comments or can explain your changes, please do so below

In order to tell between a default "us" and a specified "us", I've added in a _defaulted object variable to DateTime. This feels a little crufty, but I'm not sure I can see a better option?

@benrutter
Copy link
Contributor Author

⚠️ Note that might be important in a subtle way that I haven't realised ⚠️

In order to make this consistent type wise, I've actually altered the narwhals/v1 type signature for dtypes. This feels like it could be a red-flag depending how type-strict folks our? Essentially, a None value can now (and is by default) be passed to time_unit, which under the hood switched to us but indicates that the time_unit has been set by default rather than explicitly.

I'm pretty sure this behaviour doesn't actually change anything for anyone's code, and it definitely doesn't invalidate any existing code, but editing stable/v1 makes me feel nervous πŸ˜…

Type hints, including stable/v1 type change

test fixes
@dangotbanned dangotbanned self-requested a review August 19, 2025 17:50
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.

warn or raise on explicit incompatible TimeUnit
1 participant