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

chore: IntoImplementation type alias #1917

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

Conversation

FBruzzesi
Copy link
Member

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

@MarcoGorelli
Copy link
Member

thanks for doing this

not totally sure about this one, some thoughts:

  • the docs now show IntoImplementation, rather than a more explicit union
  • the argument is backend but the type hint is IntoImplementation
  • currently, we convert everything to nw.Implementation, but in theory I think we should be able to accept native namespaces which are from extensions

@FBruzzesi
Copy link
Member Author

thanks for doing this

not totally sure about this one, some thoughts:

  • the docs now show IntoImplementation, rather than a more explicit union
  • the argument is backend but the type hint is IntoImplementation

Makes sense! I am ok with leaving the signature as it is with the union

  • currently, we convert everything to nw.Implementation, but in theory I think we should be able to accept native namespaces which are from extensions

This would require to rethink the codebase, not just the signature πŸ™ˆ

@dangotbanned
Copy link

https://narwhals-dev.github.io/narwhals/api-reference/dataframe/#narwhals.dataframe.DataFrame.lazy

not totally sure about this one, some thoughts:

* the docs now show `IntoImplementation`, rather than a more explicit union

@MarcoGorelli I imagined the docs for DataFrame.lazy would work in the same way as from_native

  • on the API reference, you'd have a link to expand the alias
  • in an editor, you'd expand the union (and docstring) on hover

Is that not a positive?

@MarcoGorelli
Copy link
Member

I thought it would, but when I built this locally then it didn't show up. Though for some reason Implementation already doesn't show up https://narwhals-dev.github.io/narwhals/api-reference/dataframe/#narwhals.dataframe.DataFrame.lazy πŸ€”

@dangotbanned
Copy link

I thought it would, but when I built this locally then it didn't show up. Though for some reason Implementation already doesn't show up narwhals-dev.github.io/narwhals/api-reference/dataframe#narwhals.dataframe.DataFrame.lazy πŸ€”

Oh, is that because there isn't a page for Implementation?
https://narwhals-dev.github.io/narwhals/api-reference/

I went looking for one when I wrote this but settled on linking to source:
https://github.com/vega/altair/blob/94220be0115e8b13d2ebc686552edf68fd841a54/altair/datasets/_reader.py#L137-L143

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.

3 participants