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

[pull] main from microsoft:main #683

Merged
merged 3 commits into from
Nov 27, 2024
Merged

[pull] main from microsoft:main #683

merged 3 commits into from
Nov 27, 2024

Conversation

pull[bot]
Copy link

@pull pull bot commented Nov 27, 2024

See Commits and Changes for more details.


Created by pull[bot] (v2.0.0-alpha.1)

Can you help keep this open source service alive? 💖 Please sponsor : )

Summary by Sourcery

Remove unused SQL relationship handling code and improve Swagger file selection logic by incorporating version comparison. Update tests to align with these changes.

Enhancements:

  • Remove unused SQL relationship code from CdpTableResolver to simplify the codebase.
  • Improve Swagger file selection by adding version comparison logic to handle cases with identical operation counts.

Tests:

  • Update PowerPlatformTabularTests to reflect changes in SQL relationship handling, ensuring tests align with the new logic.

LucGenetier and others added 3 commits November 27, 2024 16:32
Was throwing a NullRefException for some connectors having option sets
See #2755 

Get a real fix next

Co-authored-by: Mike <[email protected]>
@pull pull bot added the ⤵️ pull label Nov 27, 2024
@pull pull bot merged commit 216c29c into admariner:main Nov 27, 2024
Copy link

sourcery-ai bot commented Nov 27, 2024

Reviewer's Guide by Sourcery

This PR removes SQL relationship handling functionality from the CDP table resolver as these relationships are not equivalent to those found in Dataverse or ServiceNow. The code is commented out for future reference rather than being completely deleted. Additionally, it adds version detection logic for swagger files and fixes a flaky test.

Updated class diagram for CdpTableResolver

classDiagram
    class CdpTableResolver {
        +ResolveTableAsync(string tableName, CancellationToken cancellationToken) ConnectorType
        -List<SqlRelationship> sqlRelationships
        -GetSqlRelationships(string text) List<SqlRelationship>
    }

    class SqlRelationship {
        -string RelationshipName
        -string ParentTable
        -string ColumnName
        -string ReferencedTable
        -string ReferencedColumnName
    }

    CdpTableResolver --> SqlRelationship : uses

    note for CdpTableResolver "SQL relationship handling is commented out for future reference."
Loading

Updated class diagram for ConnectorType

classDiagram
    class ConnectorType {
        +ConnectorType(JsonElement schema, string tableName, SymbolTable optionSets, ConnectorCompatibility compatibility, IList<ReferencedEntity> referencedEntities, string datasetName, string name, string connectorName, ICdpTableResolver resolver, ServiceCapabilities serviceCapabilities, bool isTableReadOnly)
        -SetRelationship(SqlRelationship relationship)
    }

    class SqlRelationship {
        -string RelationshipName
        -string ParentTable
        -string ColumnName
        -string ReferencedTable
        -string ReferencedColumnName
    }

    ConnectorType --> SqlRelationship : removed

    note for ConnectorType "SQL relationship handling is removed."
Loading

Updated class diagram for SwaggerFileIdentification

classDiagram
    class SwaggerFileIdentification {
        +LocateSwaggerFiles(string[] folders, string searchPattern) Dictionary<string, string>
        -GetVersion(string str) int
    }

    note for SwaggerFileIdentification "Added version detection logic for swagger files."
Loading

File-Level Changes

Change Details Files
Removed SQL relationship handling functionality
  • Commented out SQL relationship retrieval and processing code
  • Removed SqlRelationship class and related parameters
  • Updated method signatures to remove SQL relationship parameters
  • Modified tests to reflect removal of relationship functionality
src/libraries/Microsoft.PowerFx.Connectors/Tabular/CdpTableResolver.cs
src/libraries/Microsoft.PowerFx.Connectors/OpenApiExtensions.cs
src/libraries/Microsoft.PowerFx.Connectors/Public/ConnectorType.cs
src/libraries/Microsoft.PowerFx.Connectors/ConnectorFunction.cs
src/tests/Microsoft.PowerFx.Connectors.Tests.Shared/PowerPlatformTabularTests.cs
Added version detection for swagger files
  • Implemented version number extraction using regex
  • Added logic to select higher version when multiple swagger files have same operation count
src/tests/Microsoft.PowerFx.TexlFunctionExporter.Shared/SwaggerFileIdentification.cs
Disabled flaky cancellation test src/tests/Microsoft.PowerFx.Interpreter.Tests.Shared/LanguageServiceProtocol/RedesignedLanguageServerTests/CancellationTests.cs

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time. You can also use
    this command to specify where the summary should be inserted.

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

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

Successfully merging this pull request may close these issues.

2 participants