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

BUG- support pandas series #1199

Open
2 tasks
jrobinAV opened this issue Apr 17, 2024 · 5 comments
Open
2 tasks

BUG- support pandas series #1199

jrobinAV opened this issue Apr 17, 2024 · 5 comments
Assignees
Labels
Core: Data node 🆘 Help wanted Open to participation from the community 💥Malfunction Addresses an identified problem. 🟧 Priority: High Must be addressed as soon

Comments

@jrobinAV
Copy link
Member

jrobinAV commented Apr 17, 2024

Description
Running mypy generates some errors:

mypy --ignore-missing-imports --implicit-optional --no-namespace-packages --exclude '(taipy/templates/|generate_pyi.py|tools)' --follow-imports skip --disable-error-code import-untyped --show-column-numbers --hide-error-context .

Some errors relate to the returned type of the _convert_data_to_dataframe method in _abstract_tabular, Union[pd.DataFrame, pd.Series].

The error is that the callers cannot accept a pd.Series type.

taipy\core\data\sql_table.py:126:13: error: 
Argument 1 to "__insert_dataframe" of "SQLTableDataNode" has incompatible type "DataFrame | Series[Any]"; expected "DataFrame"  [arg-type]
taipy\core\data\parquet.py:250:18: error: 
Incompatible types in assignment (expression has type "DataFrame | Series[Any]", variable has type "DataFrame")  [assignment]

Acceptance Criteria

  • Exhibit the bug in a unit test
  • Fix the issue
@jrobinAV jrobinAV added 💥Malfunction Addresses an identified problem. 🟧 Priority: High Must be addressed as soon Core: Data node 🆘 Help wanted Open to participation from the community labels Apr 17, 2024
@SarthakNikhal
Copy link

@jrobinAV I want to work in this issue. Already downloaded and exploring the code. Please let me know how I can reproduce, if possible in code

@jrobinAV
Copy link
Member Author

Thank you for your help.

The issue is about a wrong type error generated by mypy. Running the following mypy command should show you the error (and its line) about the returned type.

mypy --ignore-missing-imports --implicit-optional --no-namespace-packages --exclude '(taipy/templates/|generate_pyi.py|tools)' --follow-imports skip --disable-error-code import-untyped --show-column-numbers --hide-error-context .

The purpose of the current ticket is first to exhibit a use case in a unit test that is failing.
Once the use case is exhibited, we should understand how to fix the problem.

@SarthakNikhal
Copy link

@jrobinAV What is the generate_pyi file

@jrobinAV
Copy link
Member Author

Hello @SarthakNikhal,

It is a script used to generate some pyi files during the build time. They are not used at run time. That's why we are excluding the file from the mypy command line. You should not need to look at it for working on this issue.

Thanks again for helping us.

@jrobinAV
Copy link
Member Author

@SarthakNikhal Any news on this ticket?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Core: Data node 🆘 Help wanted Open to participation from the community 💥Malfunction Addresses an identified problem. 🟧 Priority: High Must be addressed as soon
Projects
None yet
Development

No branches or pull requests

2 participants