Skip to content

Conversation

@dangotbanned
Copy link
Contributor

Discovered during narwhals-dev/narwhals#2007

I worked around it with this, but seemed simple enough to upstream:

def _type(self: pa.ChunkedArray[pa.Scalar[_DataType_CoT]]) -> _DataType_CoT:
    if TYPE_CHECKING:
        return self[0].type
    return self.type

Discovered during narwhals-dev/narwhals#2007

I worked around this with this, but seemed simple enough to upstream:
```py
def _type(self: pa.ChunkedArray[pa.Scalar[_DataType_CoT]]) -> _DataType_CoT:
    if TYPE_CHECKING:
        return self[0].type
    return self.type
```
@dangotbanned
Copy link
Contributor Author

Found quite a lot of other things in (narwhals-dev/narwhals#2007) that could help improve ChunkedArray support.

I had seen #169, but that narwhals PR revealed many more that could be widened from Array

@zen-xu zen-xu merged commit 5cad279 into zen-xu:main Feb 20, 2025
2 checks passed
@dangotbanned dangotbanned deleted the chunkedarray-type branch February 20, 2025 01:11
@dangotbanned
Copy link
Contributor Author

@zen-xu do you have a preference on resolving these?
https://github.com/search?q=repo%3Anarwhals-dev%2Fnarwhals+path%3A%2F%5Enarwhals%5C%2F_arrow%5C%2F%2F+%22Incomplete%22&type=code&rgh-link-date=2025-02-19T09%3A31%3A12Z

  1. I could make a general issue to track all the things we need fixing in (https://github.com/narwhals-dev/narwhals)?
    i. There are some that are related
    ii. but all of these were only documented as of (fix(typing): Resolve all mypy & pyright errors for _arrow narwhals-dev/narwhals#2007)
  2. Just jump straight to the PRs?

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.

2 participants