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

refactor(loader): renames _load_from_source to _load_from_local_source removes unreachable code and adds tests for _load_from_local_source #1514

Merged
merged 4 commits into from
Jan 13, 2025

Conversation

scaliseraoul
Copy link

@scaliseraoul scaliseraoul commented Jan 13, 2025

_load_from_source was only called in one place after checking for self.schema["source"]["type"] in LOCAL_SOURCE_TYPES:meaning the code after the same check was unreachable and unsafe. Renamed for consistency and added tests


Important

Refactor _load_from_source to _load_from_local_source, remove unreachable code, and add tests for _load_from_local_source.

  • Refactor:
    • Rename _load_from_source to _load_from_local_source in loader.py.
    • Remove unreachable code related to query execution in _load_from_local_source.
  • Tests:
    • Add test_load_from_local_source_valid and test_load_from_local_source_invalid_source_type in test_loader.py to verify behavior of _load_from_local_source.
    • Update test_load_from_cache to use _load_from_local_source.

This description was created by Ellipsis for 01c125b. It will automatically update as commits are pushed.

…e, removes unreachable code and adds tests for _load_from_local_source
…into release/v3

* 'release/v3' of https://github.com/scaliseraoul/pandas-ai:
  ci: fix lint
  refactor: remove workspace
@dosubot dosubot bot added the size:M This PR changes 30-99 lines, ignoring generated files. label Jan 13, 2025
Copy link

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

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

❌ Changes requested. Reviewed everything up to 01c125b in 56 seconds

More details
  • Looked at 102 lines of code in 2 files
  • Skipped 0 files when reviewing.
  • Skipped posting 1 drafted comments based on config settings.
1. pandasai/data_loader/loader.py:175
  • Draft comment:
    Ensure that InvalidDataSourceType is defined and imported correctly to avoid runtime errors when raising this exception.
  • Reason this comment was not posted:
    Comment did not seem useful.

Workflow ID: wflow_NsgdJOZBNiboVtVh


Want Ellipsis to fix these issues? Tag @ellipsis-dev in a comment. You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet mode, and more.

pandasai/data_loader/loader.py Outdated Show resolved Hide resolved
Co-authored-by: ellipsis-dev[bot] <65095814+ellipsis-dev[bot]@users.noreply.github.com>
@gventuri gventuri merged commit 5030471 into Sinaptik-AI:release/v3 Jan 13, 2025
10 of 12 checks passed
scaliseraoul added a commit to scaliseraoul/pandas-ai that referenced this pull request Jan 14, 2025
…into release/v3

* 'release/v3' of https://github.com/scaliseraoul/pandas-ai:
  refactor(loader): renames _load_from_source to _load_from_local_source removes unreachable code and adds tests for _load_from_local_source (Sinaptik-AI#1514)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size:M This PR changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants