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

TypeCast error is thrown when the spreadsheet is not initialised correctly #4505

Closed
sahanHe opened this issue May 30, 2023 · 1 comment
Closed
Assignees
Labels
module/persist Reason/EngineeringMistake The issue occurred due to a mistake made in the past. Team/DIU Data, IO, and Util packages related issues Type/Bug

Comments

@sahanHe
Copy link

sahanHe commented May 30, 2023

Description:

Let's assume a code segment to read a row from a google sheets using getByKey method.

Workspace|error workspaceError = rainierClient->/workspaces/[1].get();

when the code is executed inside for spreadsheet which is not initialised correctly (number of headers is not equal to the number of fields in entity), we get the following type cast error.

error: {ballerina}TypeCastError {"message":"incompatible types: 'error' cannot be cast to '(test:WorkspaceWithRelations|persist:Error)'"}
        at sahan.test.0.Client:$get$workspaces$^(persist_client.bal:264)
           sahan.test.0:checkWorkspace(main.bal:171)
           sahan.test.0:main(main.bal:349)

Affected Versions:
persist-1.0.0

Suggested Labels (optional):

Suggested Assignees (optional):

@github-actions
Copy link

This issue is NOT closed with a proper Reason/ label. Make sure to add proper reason label before closing. Please add or leave a comment with the proper reason label now.

      - Reason/EngineeringMistake - The issue occurred due to a mistake made in the past.
      - Reason/Regression - The issue has introduced a regression.
      - Reason/MultipleComponentInteraction - Issue occured due to interactions in multiple components.
      - Reason/Complex - Issue occurred due to complex scenario.
      - Reason/Invalid - Issue is invalid.
      - Reason/Other - None of the above cases.

@sahanHe sahanHe added the Reason/EngineeringMistake The issue occurred due to a mistake made in the past. label Jun 27, 2023
@sahanHe sahanHe reopened this Jul 4, 2023
@daneshk daneshk closed this as completed Sep 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
module/persist Reason/EngineeringMistake The issue occurred due to a mistake made in the past. Team/DIU Data, IO, and Util packages related issues Type/Bug
Projects
Archived in project
Development

No branches or pull requests

2 participants