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

chore: unpin pydantic #967

Merged
merged 4 commits into from
Dec 10, 2024
Merged

chore: unpin pydantic #967

merged 4 commits into from
Dec 10, 2024

Conversation

tushar-composio
Copy link
Contributor

@tushar-composio tushar-composio commented Dec 9, 2024

Important

Unpin pydantic version in setup.py and update type annotations across multiple files for compatibility with newer versions.

  • Setup:
    • Unpin pydantic version in setup.py, changing from pydantic>=2.6.4,<2.10 to pydantic>=2.6.4.
  • Type Annotations:
    • Update type annotations to use t.Optional for fields that can be None in api.py, bash.py, and text_editor.py.
    • Similar updates in 50+ other files to ensure compatibility with newer pydantic versions.
  • Misc:
    • Minor import changes in shared.py to use PydanticUndefined.

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

Copy link

vercel bot commented Dec 9, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
composio ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 9, 2024 10:33am

Copy link

github-actions bot commented Dec 9, 2024

This comment was generated by github-actions[bot]!

JS SDK Coverage Report

📊 Coverage report for JS SDK can be found at the following URL:
https://pub-92e668239ab84bfd80ee07d61e9d2f40.r2.dev/coverage-12233782740/coverage/index.html

📁 Test report folder can be found at the following URL:
https://pub-92e668239ab84bfd80ee07d61e9d2f40.r2.dev/html-report-12233782740/html-report/report.html

@shreysingla11
Copy link
Collaborator

Code Review Summary

Overall Assessment

The changes look good overall, with a focus on improving type safety and dependency management. The PR makes two main types of changes:

  1. Pydantic Version Change:

    • Removes upper bound constraint for pydantic version
    • Allows using newer pydantic versions beyond 2.10
  2. Type System Improvements:

    • Properly marks optional fields with t.Optional[]
    • Standardizes imports to use import typing as t
    • Makes type hints more explicit across multiple classes

Strengths

  • Consistent approach to marking optional fields
  • Better type safety through explicit Optional types
  • Standardized import style across files
  • Improved static type checking potential

Suggestions for Improvement

  1. Documentation:

    • Add comments explaining the pydantic version change rationale
    • Consider adding/improving class docstrings
    • Document any compatibility testing done
  2. Type Safety:

    • Consider using more specific type hints for Dict types
    • Add type hints for remaining untyped parameters
  3. Testing:

    • Ensure comprehensive testing with newer pydantic versions
    • Document any known compatibility issues

Rating: 8/10

Good improvements to type safety and dependency management, with minor suggestions for documentation and type specificity.

Copy link
Contributor

@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 0f99f9e in 1 minute and 11 seconds

More details
  • Looked at 2193 lines of code in 66 files
  • Skipped 0 files when reviewing.
  • Skipped posting 4 drafted comments based on config settings.
1. python/composio/server/api.py:80
  • Draft comment:
    Changing metadata to Optional[Dict] might lead to issues if the rest of the codebase assumes this field is always a dictionary. Ensure that the code handles None values appropriately wherever this field is used.
  • Reason this comment was not posted:
    Comment did not seem useful.
2. python/composio/tools/local/anthropic_computer_use/actions/bash.py:16
  • Draft comment:
    Changing session_id to Optional[str] might lead to issues if the rest of the codebase assumes this field is always a string. Ensure that the code handles None values appropriately wherever this field is used.
  • Reason this comment was not posted:
    Comment did not seem useful.
3. python/composio/tools/local/clickup/actions/add_dependency.py:13
  • Draft comment:
    Changing custom_task_ids to Optional[bool] might lead to issues if the rest of the codebase assumes this field is always a boolean. Ensure that the code handles None values appropriately wherever this field is used.
  • Reason this comment was not posted:
    Comment did not seem useful.
4. python/composio/tools/local/clickup/actions/add_guest_to_folder.py:18
  • Draft comment:
    Changing include_shared to Optional[bool] might lead to issues if the rest of the codebase assumes this field is always a boolean. Ensure that the code handles None values appropriately wherever this field is used.
  • Reason this comment was not posted:
    Comment did not seem useful.

Workflow ID: wflow_i9HmL6TkH3sWItj4


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

Copy link
Contributor

@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! Incremental review on aa9bf8b in 14 seconds

More details
  • Looked at 27 lines of code in 2 files
  • Skipped 0 files when reviewing.
  • Skipped posting 1 drafted comments based on config settings.
1. python/composio/utils/shared.py:10
  • Draft comment:
    The import statement for PydanticUndefined was removed, but it is not used in the file, so this change is correct.
  • Reason this comment was not posted:
    Confidence changes required: 0%
    The import statement for PydanticUndefined from pydantic_core was removed, but it is not used anywhere in the file. This change is correct and does not affect functionality.

Workflow ID: wflow_ZSBouEXoaBytnpj1


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

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