Skip to content

chore: Add Version.namespace, remove import_namespace#2425

Merged
dangotbanned merged 2 commits intomainfrom
version-props-namespace
Apr 24, 2025
Merged

chore: Add Version.namespace, remove import_namespace#2425
dangotbanned merged 2 commits intomainfrom
version-props-namespace

Conversation

@dangotbanned
Copy link
Member

@dangotbanned dangotbanned commented Apr 23, 2025

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

  • 💾 Refactor
  • ✨ Feature
  • 🐛 Bug Fix
  • 🔧 Optimization
  • 📝 Documentation
  • ✅ Test
  • 🐳 Other

Related issues

Checklist

  • Code follows style guide (ruff)
  • Tests added
  • Documented the changes

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

Waaaaaaaay simpler and avoids needing to have an unreachable branch for the Enum.

The much bigger change I wanna make is replacing import_dtypes_module -> Version.dtypes.
Thought I'd float this one first, since:

  • that PR would touch 21 modules
  • require configuring/removing
    - id: dtypes-import
    name: don't import from narwhals.dtypes (use `import_dtypes_module` instead)
    entry: |
    (?x)
    import\ narwhals.dtypes|
    from\ narwhals\ import\ dtypes|
    from\ narwhals.dtypes\ import\ [^D_]+|
    import\ narwhals.stable.v1.dtypes|
    from\ narwhals.stable.v1\ import\ dtypes|
    from\ narwhals.stable.v1.dtypes\ import
    language: pygrep
    files: ^narwhals/
    exclude: |
    (?x)
    ^(
    narwhals/utils\.py|
    narwhals/stable/v1/_dtypes.py|
    narwhals/.*__init__.py|
    narwhals/.*typing\.py
    )

Waaaaaaaay simpler and avoids needing to have an unreachable branch for the `Enum`
@dangotbanned dangotbanned requested a review from FBruzzesi April 24, 2025 10:35
Copy link
Member

@FBruzzesi FBruzzesi left a comment

Choose a reason for hiding this comment

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

Nice, thanks @dangotbanned 👌🏼

HiThereGIF (2)

@dangotbanned dangotbanned merged commit e8e27bd into main Apr 24, 2025
29 checks passed
@dangotbanned dangotbanned deleted the version-props-namespace branch April 24, 2025 15:30
dangotbanned added a commit that referenced this pull request Apr 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants