-
Notifications
You must be signed in to change notification settings - Fork 658
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
[Feature request] Support reporting Polars Dataframes #1356
Comments
Having a look at diff --git a/pandas_reporting.py b/polars_reporting.py
index 3abe6c3..20ddb86 100644
--- a/pandas_reporting.py
+++ b/polars_reporting.py
@@ -1,5 +1,4 @@
-
-import pandas as pd
+import polars as pl
from clearml import Task, Logger
@@ -14,16 +13,15 @@ def report_table(logger, iteration=0):
# report tables
# Report table - DataFrame with index
- df = pd.DataFrame(
+ df = pl.DataFrame(
{
+ "id": ["falcon", "dog", "spider", "fish"],
"num_legs": [2, 4, 8, 0],
"num_wings": [2, 0, 0, 0],
"num_specimen_seen": [10, 2, 1, 8],
},
- index=["falcon", "dog", "spider", "fish"],
)
- df.index.name = "id"
- logger.report_table("table pd", "PD with index", iteration=iteration, table_plot=df)
+ logger.report_table("table pl", "PL with index", iteration=iteration, table_plot=df)
# Report table - CSV from path
csv_url = "https://raw.githubusercontent.com/plotly/datasets/master/Mining-BTC-180.csv" Running this as is on the latest version of ClearML results in the traceback
So a very subtle API difference |
BlakeJC94
changed the title
Support reporting Polars Dataframes
[Feature request] Support reporting Polars Dataframes
Dec 2, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Proposal Summary
Explain your proposed feature.
Add support for Polars DataFrames in the following functions:
Logger.report_table
Model.report_table
Artifact.get
Motivation
Explain the use case that needs this feature
ClearML already has great support for reporting tables and saving artifacts from Pandas DataFrames. Lately, the Polars library has increased in popularity amongst a variety of data science teams (using a proxy metric: 30.9k stars on Github vs. 43.9k for Pandas)
Polars is designed to have a similar API to pandas, however there are a couple of subtle differences that clashes with the code in ClearML where pandas DataFrames are expected.
I'm happy to take a first pass at a PR to test this concept and to see how much work is needed to fully implement
Related Discussion
If this continues a slack thread, please provide a link to the original slack thread.
The text was updated successfully, but these errors were encountered: