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

[BSE-4418] Address Pandas Warning for to_csv and to_json #216

Merged
merged 2 commits into from
Feb 7, 2025

Conversation

hadia206
Copy link
Contributor

@hadia206 hadia206 commented Feb 6, 2025

Changes included in this PR

Use keyword arguments in our internal calls to to_csv and to_json to avoid the Pandas warning.
Starting with pandas version 3.0 all arguments of to_csv except for the argument 'path_or_buf' will be keyword-only.

Testing strategy

Locally.

>>> import pandas as pd
>>> import bodo
>>> df = pd.DataFrame({"A": [1, 2, 3]})
>>> @bodo.jit(spawn=False)
... def f(df):
...   return df.to_json("text.json")
... 
>>> f(df)
/Users/hadia/Bodo/Latest_Bodo/Bodo/bodo/transforms/distributed_analysis.py:305: BodoWarning: No parallelism found for function 'f'. Distributed diagnostics:
Setting distribution of variable 'df' to REP: Distributed analysis replicated argument 'df' (variable 'df'). Set distributed flag for 'df' if distributed partitions are passed (e.g. @bodo.jit(distributed=['df'])).

File "<stdin>", line 1:
<source missing, REPL/exec in use?>
  warnings.warn(

User facing changes

Checklist

  • Pipelines passed before requesting review. To run CI you must include [run CI] in your commit message.
  • I am familiar with the Contributing Guide
  • I have installed + ran pre-commit hooks.

@@ -229,22 +229,22 @@ def to_csv(
def to_csv_wrapper(
df: pd.DataFrame,
path_or_buf,
sep,
Copy link
Contributor Author

@hadia206 hadia206 Feb 6, 2025

Choose a reason for hiding this comment

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

Changes in this file for consistency.

Copy link

codecov bot commented Feb 6, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Please upload report for BASE (main@7596dc2). Learn more about missing BASE report.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #216   +/-   ##
=======================================
  Coverage        ?   77.76%           
=======================================
  Files           ?      169           
  Lines           ?    61900           
  Branches        ?     8661           
=======================================
  Hits            ?    48135           
  Misses          ?    11673           
  Partials        ?     2092           

@hadia206 hadia206 marked this pull request as ready for review February 6, 2025 21:16
Copy link
Contributor

@IsaacWarren IsaacWarren left a comment

Choose a reason for hiding this comment

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

Thanks Hadia

Copy link
Collaborator

@ehsantn ehsantn left a comment

Choose a reason for hiding this comment

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

Thanks @hadia206 .

@hadia206 hadia206 merged commit ff2de07 into main Feb 7, 2025
22 checks passed
@hadia206 hadia206 deleted the Hadia/to_csv_json_warnings branch February 7, 2025 19:56
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.

3 participants