Skip to content

Use new function for Polars instead of deprecated ones#68

Merged
MarcoGorelli merged 11 commits intodata-apis:mainfrom
anmyachev:update-polars
Jan 23, 2024
Merged

Use new function for Polars instead of deprecated ones#68
MarcoGorelli merged 11 commits intodata-apis:mainfrom
anmyachev:update-polars

Conversation

@anmyachev
Copy link
Contributor

No description provided.

Signed-off-by: Anatoly Myachev <anatoly.myachev@intel.com>
Signed-off-by: Anatoly Myachev <anatoly.myachev@intel.com>
Signed-off-by: Anatoly Myachev <anatoly.myachev@intel.com>
Signed-off-by: Anatoly Myachev <anatoly.myachev@intel.com>
Signed-off-by: Anatoly Myachev <anatoly.myachev@intel.com>
Signed-off-by: Anatoly Myachev <anatoly.myachev@intel.com>
Signed-off-by: Anatoly Myachev <anatoly.myachev@intel.com>
Signed-off-by: Anatoly Myachev <anatoly.myachev@intel.com>
Signed-off-by: Anatoly Myachev <anatoly.myachev@intel.com>
@anmyachev anmyachev marked this pull request as ready for review January 22, 2024 11:33
) -> DataFrame:
return self._from_dataframe(
self.dataframe.with_columns(pl.col("*").__eq__(other)),
self.dataframe.with_columns(pl.col("*").__eq__(other)), # type: ignore[operator]
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Unfortunately, I haven't found a way to fix the following errors instead of just ignoring them: dataframe_api_compat/polars_standard/dataframe_object.py:240: error: Unsupported operand types for == ("Expr" and "Union[Union[str, int, float, bool], Scalar]") [operator]

@anmyachev
Copy link
Contributor Author

@MarcoGorelli ready for review


def size(self) -> DataFrame:
result = self._grouped.count().rename({"count": "size"})
method = "len" if hasattr(self._grouped, "len") else "count"
Copy link
Contributor

Choose a reason for hiding this comment

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

not too keen on hasattr matching, could we either check against the polars version, or just bump up the minimum supported version?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Rewritten

@anmyachev anmyachev force-pushed the update-polars branch 2 times, most recently from a37d7a9 to 5668b44 Compare January 22, 2024 14:05
Signed-off-by: Anatoly Myachev <anatoly.myachev@intel.com>
Copy link
Contributor

@MarcoGorelli MarcoGorelli left a comment

Choose a reason for hiding this comment

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

thanks @anmyachev !

@MarcoGorelli MarcoGorelli merged commit d8b7766 into data-apis:main Jan 23, 2024
@anmyachev anmyachev deleted the update-polars branch January 23, 2024 12:00
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