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: add dump and dumps methods to Graph #3202

Merged
merged 26 commits into from
Aug 5, 2024
Merged

feat: add dump and dumps methods to Graph #3202

merged 26 commits into from
Aug 5, 2024

Conversation

ogabrielluiz
Copy link
Contributor

This pull request includes several refactorings and enhancements to improve the handling of graph data in the codebase.

The commits in this pull request introduce pytest fixtures for memory_chatbot_graph tests and improve the test structure. They also implement JSON serialization for graph data, enhancing the data export capabilities. Additionally, the node argument type in the add_node and _create_vertex methods has been changed to NodeData for better type safety and clarity.

The Edge class has been updated to consistently use snake_case for attributes and improve validation logic for handles. Attribute naming has been standardized and a to_data method has been added to return the edge data. The Edge class has also been refactored to improve handle validation and data handling. Consolidated imports, removed redundant BaseModel definitions, and introduced new attributes to the Edge class.

TypedDict classes have been added for graph schema serialization, including NodeData and Position for improved type safety and structure in vertex data handling. The vertex constructors have been refactored to use NodeData and input/output methods have been added for better component interaction.

Other changes include improvements to model_config formatting, retry logic for loading starter projects to enhance robustness against JSON decode errors, and enhanced validation logic when checking data types. The Output class has been streamlined to prevent duplicate entries in the types list for improved type management. Finally, an escape_json_dump function has been added to escape JSON strings for Edge dictionaries.

Overall, these changes enhance the codebase by improving test structure, serialization capabilities, type safety, data handling, and validation logic.

@ogabrielluiz ogabrielluiz enabled auto-merge (squash) August 5, 2024 19:00
@dosubot dosubot bot added size:XL This PR changes 500-999 lines, ignoring generated files. enhancement New feature or request labels Aug 5, 2024
Copy link
Contributor

github-actions bot commented Aug 5, 2024

Pull Request Validation Report

This comment is automatically generated by Conventional PR

Whitelist Report

Whitelist Active Result
Pull request is a draft and should be ignored
Pull request is made by a whitelisted user and should be ignored
Pull request is submitted by a bot and should be ignored
Pull request is submitted by administrators and should be ignored

Result

Pull request does not satisfy any enabled whitelist criteria. Pull request will be validated.

Validation Report

Validation Active Result
All commits in this pull request has valid messages
Pull request does not introduce too many changes
Pull request has a valid title
Pull request has mentioned issues
Pull request has valid branch name
Pull request should have a non-empty body

Result

Pull request satisfies all enabled pull request rules.

Last Modified at 05 Aug 24 19:01 UTC

@github-actions github-actions bot added enhancement New feature or request and removed enhancement New feature or request labels Aug 5, 2024
Copy link

This pull request is automatically being deployed by Amplify Hosting (learn more).

Access this pull request here: https://pr-3202.dmtpw4p5recq1.amplifyapp.com

…tries in types list for improved type management
… enhance robustness against JSON decode errors
…_type alias for clarity and consistency in field definitions
…input/output methods for better component interaction
…pe safety and structure in vertex data handling
- Consolidated imports and removed redundant `BaseModel` definitions for `SourceHandle` and `TargetHandle`.
- Added `valid_handles`, `target_param`, and `_target_handle` attributes to `Edge` class.
- Enhanced handle validation logic to distinguish between dictionary and string types.
- Introduced `to_data` method to return edge data.
- Updated attribute names to follow consistent naming conventions (`base_classes`, `input_types`, `field_name`).
…ge class

- Renamed attributes to use snake_case consistently (`baseClasses` to `base_classes`, `inputTypes` to `input_types`, `fieldName` to `field_name`).
- Added `to_data` method to return `_data` attribute.
- Updated validation methods to use new attribute names.
…utes and improve validation logic for handles
…thods to NodeData for better type safety and clarity
…d `dump` methods, enhancing data export capabilities
…est structure for better clarity and organization
@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Aug 5, 2024
…rganization and maintainability in api_utils.py
…rganization and maintainability in prompt.py
… workflow

- Introduced `async` variable in Makefile to conditionally run unit tests with or without parallel execution.
- Updated `unit_tests` target in Makefile to handle `async` flag.
- Modified GitHub Actions workflow to set `async=false` for unit tests.
@ogabrielluiz ogabrielluiz merged commit bb1bc5c into main Aug 5, 2024
50 checks passed
@ogabrielluiz ogabrielluiz deleted the feat/genjson2 branch August 5, 2024 21:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request lgtm This PR has been approved by a maintainer size:XL This PR changes 500-999 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants