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

feat(SemanticLayerSchema): Adding a SemanticLayerSchema class with logical and business validation #1516

Merged
merged 6 commits into from
Jan 14, 2025

Conversation

scaliseraoul
Copy link

@scaliseraoul scaliseraoul commented Jan 14, 2025

feat(SemanticLayerSchema): Adding a SemanticLayerSchema class with logical and business validation


Important

Add SemanticLayerSchema class with validation logic and tests for defining and validating data schemas.

  • SemanticLayerSchema:
    • New SemanticLayerSchema class in semantic_layer_schema.py for defining and validating data schemas.
    • Includes Column, Transformation, Source, and Destination classes with validation logic.
    • Validates column types, transformation types, and source types against predefined constants.
    • Validates presence of required fields based on source type (local vs remote).
  • Tests:
    • Added tests in test_semantic_layer_schema.py to validate schema creation and error handling.
    • Tests for valid and invalid schemas, including missing fields and unsupported types.
    • Tests for is_schema_source_same() function to compare schema sources.

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

scaliseraoul and others added 6 commits January 13, 2025 15:32
…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
Co-authored-by: ellipsis-dev[bot] <65095814+ellipsis-dev[bot]@users.noreply.github.com>
…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)
@dosubot dosubot bot added the size:M This PR changes 30-99 lines, ignoring generated files. label Jan 14, 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.

👍 Looks good to me! Reviewed everything up to c5afb38 in 1 minute and 9 seconds

More details
  • Looked at 831 lines of code in 36 files
  • Skipped 0 files when reviewing.
  • Skipped posting 8 drafted comments based on config settings.
1. extensions/connectors/sql/tests/test_sql.py:2
  • Draft comment:
    The import order should follow PEP 8 guidelines. Standard library imports should be placed before third-party imports. Consider reordering the imports accordingly.
  • Reason this comment was not posted:
    Confidence changes required: 10%
    The import order in Python should follow the PEP 8 guidelines, which suggest that standard library imports should be placed before third-party imports. In this file, the import order is incorrect as 'pandas as pd' is imported before 'unittest.mock'.
2. extensions/connectors/yfinance/tests/test_yahoo_finance.py:2
  • Draft comment:
    The import order should follow PEP 8 guidelines. Standard library imports should be placed before third-party imports. Consider reordering the imports accordingly.
  • Reason this comment was not posted:
    Confidence changes required: 10%
    The import order in Python should follow the PEP 8 guidelines, which suggest that standard library imports should be placed before third-party imports. In this file, the import order is incorrect as 'pandas as pd' is imported before 'unittest.mock'.
3. extensions/ee/connectors/bigquery/pandasai_bigquery/__init__.py:1
  • Draft comment:
    The import order should follow PEP 8 guidelines. Standard library imports should be placed before third-party imports. Consider reordering the imports accordingly.
  • Reason this comment was not posted:
    Confidence changes required: 10%
    The import order in Python should follow the PEP 8 guidelines, which suggest that standard library imports should be placed before third-party imports. In this file, the import order is incorrect as 'pandas as pd' is imported before 'google.cloud.bigquery'.
4. extensions/ee/connectors/bigquery/tests/test_bigquery.py:3
  • Draft comment:
    The import order should follow PEP 8 guidelines. Standard library imports should be placed before third-party imports. Consider reordering the imports accordingly.
  • Reason this comment was not posted:
    Confidence changes required: 10%
    The import order in Python should follow the PEP 8 guidelines, which suggest that standard library imports should be placed before third-party imports. In this file, the import order is incorrect as 'pandas as pd' is imported before 'pytest'.
5. extensions/ee/connectors/oracle/tests/test_oracle.py:2
  • Draft comment:
    The import order should follow PEP 8 guidelines. Standard library imports should be placed before third-party imports. Consider reordering the imports accordingly.
  • Reason this comment was not posted:
    Confidence changes required: 10%
    The import order in Python should follow the PEP 8 guidelines, which suggest that standard library imports should be placed before third-party imports. In this file, the import order is incorrect as 'pandas as pd' is imported before 'unittest.mock'.
6. extensions/ee/connectors/snowflake/tests/test_snowflake.py:2
  • Draft comment:
    The import order should follow PEP 8 guidelines. Standard library imports should be placed before third-party imports. Consider reordering the imports accordingly.
  • Reason this comment was not posted:
    Confidence changes required: 10%
    The import order in Python should follow the PEP 8 guidelines, which suggest that standard library imports should be placed before third-party imports. In this file, the import order is incorrect as 'pandas as pd' is imported before 'unittest.mock'.
7. extensions/llms/google/tests/test_google_vertexai.py:3
  • Draft comment:
    The import order should follow PEP 8 guidelines. Standard library imports should be placed before third-party imports. Consider reordering the imports accordingly.
  • Reason this comment was not posted:
    Confidence changes required: 10%
    The import order in Python should follow the PEP 8 guidelines, which suggest that standard library imports should be placed before third-party imports. In this file, the import order is incorrect as 'pandas as pd' is imported before 'unittest.mock'.
8. pandasai/data_loader/semantic_layer_schema.py:30
  • Draft comment:
    Consider rephrasing the error message for clarity and consistency.
raise ValueError(f"Column type '{type}' is not supported.")

This suggestion also applies to the is_transformation_type_supported method on line 44.

  • Reason this comment was not posted:
    Confidence changes required: 50%
    The error message in the is_column_type_supported and is_transformation_type_supported methods could be improved for clarity and consistency.

Workflow ID: wflow_dyWw08JCYG3ggsbm


You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet mode, and more.

@gventuri gventuri merged commit cddbabd into Sinaptik-AI:release/v3 Jan 14, 2025
10 of 12 checks passed
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