Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@lveillard
Copy link
Member

@lveillard lveillard commented Jun 8, 2024

πŸš€ This description was created by Ellipsis for commit 251b359

Summary:

This PR introduces multi-value field handling in queries for TypeDB and SurrealDB, with comprehensive updates across scripts, configurations, and tests.

Key points:

  • Introduced handling for multi-value fields in queries for TypeDB and SurrealDB.
  • Updated scripts, configurations, and tests to support new feature.
  • Improved error handling and processing in test cases.
  • Modified core functionalities in query building and parsing to accommodate multi-value fields.

Generated with ❀️ by ellipsis.dev

@lveillard lveillard added the sweep label Jun 8, 2024
@sweep-ai-deprecated
Copy link
Contributor

sweep-ai-deprecated bot commented Jun 8, 2024

Sweep: PR Review

Author: lveillard

Sweep Found These Issues

src/types/schema/fields.ts
  • Sweep has identified a redundant function: While fn? provides a unique boolean type check not found in the other code, it is an extremely simple utility that could be inlined anywhere a boolean check is needed without loss of functionality. It does not seem critical to keep as a standalone function.
  • fn?: (value: unknown) => boolean;

    View Diff


Potential Issues

Sweep is unsure if these are issues, but they might be worth checking out.

src/stateMachine/query/tql/parse.ts
  • The code does not handle the case where multiValKey does not exist or is not an array, which could cause errors.
  • multiValKeys.forEach((multiValKey) => {
    const multiValKeyWithout$multiVal = multiValKey.replace(/\.\$multiVal$/, '');
    const realValue = obj[multiValKey][0][multiValKeyWithout$multiVal].attribute; //there is an easier way for sure
    // eslint-disable-next-line no-param-reassign
    obj[dataFieldsKey][multiValKeyWithout$multiVal] = realValue;

    View Diff

Details

tests/typedb/mocks/schema.tql
  • The removal and reintroduction of ColorΒ·name and ColorΒ·value attributes might affect existing queries or operations that rely on these attributes being defined at the top level.
  • # User
    UserΒ·email sub email;

    View Diff


Summary

This pull request introduced support for MultiValues queries and updated the testing framework to conditionally ignore certain todos based on the database being tested.

The main feature was implemented in src/stateMachine/query/tql/build.ts by adding logic to handle fields with a contentType of 'FLEX'. The processDataFields function was updated to identify these fields and generate the necessary query lines to fetch their attributes.

In src/stateMachine/query/tql/parse.ts, the parseFields function was modified to process and replace multi-value keys in the object, ensuring that the correct values are assigned.

A new type MultiField was added to src/types/schema/fields.ts, allowing fields with flexible content types to be defined and validated. This type was also included in the AllDataField union type to enhance versatility.

The tests/mocks/schema.ts and tests/surrealdb/mocks/schema.surql files were updated to include a new freeForAll field with a FLEX content type in the Color entity, and corresponding data entries were added in tests/surrealdb/mocks/data.surql.

Several test cases were added and updated in tests/unit/queries/query.ts to verify the functionality of MultiValues queries, including tests for querying and filtering by multi-value fields.

Minor changes included reformatting code for readability and updating test descriptions to include {TS} tags for categorization.


The following files were not reviewed because our filter identified them as typically non-human-readable (auto-generated) or less important files (e.g., dist files, package.json, images). If this is an error, please let us know.

  • .husky/pre-commit
  • package.json

@ellipsis-dev
Copy link
Contributor

ellipsis-dev bot commented Jun 8, 2024

Sorry, I don't know how to help with that. If you tag me (@ellipsis-dev) in a comment, I can do one of these things (but not multiple at once):

  • review and summarize this pull request
  • make changes to this pull request
  • answer questions about this PR, or about the codebase in general
  • hide my old reviews on this PR (to reduce clutter)

@lveillard
Copy link
Member Author

@ellipsis-dev, can you review and summarize this pull request

@ellipsis-dev
Copy link
Contributor

ellipsis-dev bot commented Jun 8, 2024

OK! Reviewing this PR...


Responding to this comment by @lveillard. For more information about Ellipsis, check the documentation.

@lveillard lveillard marked this pull request as ready for review June 8, 2024 14:30
@lveillard lveillard changed the title Feat-multiVal Draft: Feat-multiVal Jun 8, 2024
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 8756d10 in 1 minute and 29 seconds

More details
  • Looked at 673 lines of code in 21 files
  • Skipped 0 files when reviewing.
  • Skipped posting 1 drafted comments based on config settings.
1. tests/unit/schema/define.ts:5
  • Draft comment:
    This test case is marked as TODO but lacks any assertions or meaningful test logic. Consider implementing the test or removing it if it's not necessary.
  • Reason this comment was not posted:
    Confidence of 0% on close inspection, compared to threshold of 50%.

Workflow ID: wflow_jalN8pDZmvLctGc9


You can customize Ellipsis with πŸ‘ / πŸ‘Ž feedback, review rules, user-specific overrides, quiet mode, and more.

βŒ› 5 days left in your free trial, upgrade for $20/seat/month or contact us.

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 8756d10 in 1 minute and 40 seconds

More details
  • Looked at 673 lines of code in 21 files
  • Skipped 0 files when reviewing.
  • Skipped posting 1 drafted comments based on config settings.
1. tests/unit/schema/define.ts:5
  • Draft comment:
    This test case is marked as TODO and lacks implementation. Please either implement the test logic or remove the placeholder if it's not needed.
  • Reason this comment was not posted:
    Confidence of 0% on close inspection, compared to threshold of 50%.

Workflow ID: wflow_fqPWa7tuyQEWTqXY


You can customize Ellipsis with πŸ‘ / πŸ‘Ž feedback, review rules, user-specific overrides, quiet mode, and more.

βŒ› 5 days left in your free trial, upgrade for $20/seat/month or contact us.

@lveillard
Copy link
Member Author

@ellipsis-dev summarize this PR

@ellipsis-dev
Copy link
Contributor

ellipsis-dev bot commented Jun 8, 2024

OK! Reviewing this PR...


Responding to this comment by @lveillard. For more information about Ellipsis, check the documentation.

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 fa7e1b6 in 2 minutes and 28 seconds

More details
  • Looked at 108 lines of code in 1 files
  • Skipped 0 files when reviewing.
  • Skipped posting 0 drafted comments based on config settings.

Workflow ID: wflow_ysbYh4pxYbjIcSBa


You can customize Ellipsis with πŸ‘ / πŸ‘Ž feedback, review rules, user-specific overrides, quiet mode, and more.

βŒ› 4 days left in your free trial, upgrade for $20/seat/month or contact us.

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 251b359 in 43 seconds

More details
  • Looked at 15 lines of code in 1 files
  • Skipped 0 files when reviewing.
  • Skipped posting 1 drafted comments based on config settings.
1. changelog.md:8
  • Draft comment:
    The indentation for the bullet points under 'Feat' in version 0.10.14 is inconsistent. Please correct the indentation to maintain uniformity and improve readability.
  • Reason this comment was not posted:
    Confidence of 0% on close inspection, compared to threshold of 50%.

Workflow ID: wflow_GoLZEAcDDD9mFgWi


You can customize Ellipsis with πŸ‘ / πŸ‘Ž feedback, review rules, user-specific overrides, quiet mode, and more.

βŒ› 4 days left in your free trial, upgrade for $20/seat/month or contact us.

@lveillard lveillard merged commit 22c32e0 into main Jun 8, 2024
@lveillard lveillard deleted the feat-multiVal branch June 8, 2024 18:07
@lveillard
Copy link
Member Author

@ellipsis-dev this PR introduced a bug:
cannot read properties of undefined (reading thing)

Where in this PR we introduced a .thing that might fail?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants