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

translate ModelValidationException to 4XX #489

Merged
merged 1 commit into from
Jan 2, 2025

Conversation

JiaoMaWHU
Copy link
Contributor

Summary

we had large amount of exceptions like this

com.linkedin.metadata.dao.exception.ModelValidationException: failed to get aspect alias for: com.linkedin.dataset.DatasetProperties from asset: class pegasus.com.linkedin.metadata.asset.GrpcMethodAsset:
    at com.linkedin.metadata.dao.utils.SQLSchemaUtils.getColumnName(SQLSchemaUtils.java:225)
    at com.linkedin.metadata.dao.utils.SQLSchemaUtils.getAspectColumnName(SQLSchemaUtils.java:131)
    at com.linkedin.metadata.dao.utils.SQLSchemaUtils.getAspectColumnName(SQLSchemaUtils.java:151)
    at com.linkedin.metadata.dao.EbeanLocalAccess.batchGetUnion(EbeanLocalAccess.java:179)
    at com.linkedin.metadata.dao.EbeanLocalDAO.batchGetHelper(EbeanLocalDAO.java:1148)
    at com.linkedin.metadata.dao.EbeanLocalDAO.batchGet(EbeanLocalDAO.java:1078)
    at com.linkedin.metadata.dao.EbeanLocalDAO.get(EbeanLocalDAO.java:975)
    at com.linkedin.metadata.restli.BaseAspectRoutingResource.getInternalAspectsFromLocalDao(BaseAspectRoutingResource.java:548)
    at com.linkedin.metadata.restli.BaseAspectRoutingResource.lambda$getSnapshot$2(BaseAspectRoutingResource.java:160)
    at com.linkedin.metadata.restli.RestliUtils.toTask(RestliUtils.java:35)
    at com.linkedin.metadata.restli.BaseAspectRoutingResource.getSnapshot(BaseAspectRoutingResource.java:157)
    at com.linkedin.metadata.restli.BaseAspectRoutingResource.getSnapshot(BaseAspectRoutingResource.java:146)
    at com.linkedin.service.rest.resources.grpcmethod.GrpcMethods.getSnapshot(GrpcMethods.java:243)
    at jdk.internal.reflect.GeneratedMethodAccessor236.invoke

this pr translates this type of exception to to a 4XX restli service exception

Testing Done

./gradlew build

Checklist

@codecov-commenter
Copy link

Codecov Report

Attention: Patch coverage is 44.18605% with 24 lines in your changes missing coverage. Please review.

Project coverage is 66.18%. Comparing base (d3f8bc3) to head (6ee68b8).

Files with missing lines Patch % Lines
...din/metadata/restli/BaseAspectRoutingResource.java 9.09% 20 Missing ⚠️
...m/linkedin/metadata/restli/BaseEntityResource.java 80.95% 4 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##             master     #489      +/-   ##
============================================
- Coverage     66.28%   66.18%   -0.11%     
  Complexity     1537     1537              
============================================
  Files           137      137              
  Lines          5899     5908       +9     
  Branches        655      655              
============================================
  Hits           3910     3910              
- Misses         1712     1721       +9     
  Partials        277      277              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

@ZihanLi58 ZihanLi58 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@JiaoMaWHU JiaoMaWHU merged commit d2e3af5 into master Jan 2, 2025
2 checks passed
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