Skip to content

Bug in python binding documentation : wrong filename used when reading CSV. #6056

@frex-is

Description

@frex-is

Describe the bug

The documentation contains an error in the example that demonstrates writing and reading a CSV file using the Operator. The file is written as test.csv, but the example tries to read from test123.csv, which leads to an error.

Relevant Snippet from Documentation:

file path : bindings/python/docs/examples/pandas.ipynb

# Create and write a csv file
op.write("test.csv", b"name,age\nAlice,25\nBob,30\nCharlie,35")

# Open and read the DataFrame from the file.
with op.open("test123.csv", mode="rb") as file:
    read_df = pd.read_csv(file)
    print(f"read_df: {read_df}")

Suggested Fix :

# Create and write a csv file
op.write("test.csv", b"name,age\nAlice,25\nBob,30\nCharlie,35")

# Open and read the DataFrame from the file.
with op.open("test.csv", mode="rb") as file:
    read_df = pd.read_csv(file)
    print(f"read_df: {read_df}")

Impact:

This bug can mislead users or cause confusion when trying to follow the documentation example.

Are you willing to submit a PR to fix this bug?

  • Yes, I would like to submit a PR.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bindings/pythonbugSomething isn't workingdocumentationImprovements or additions to documentation

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions