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

fix: Proxy model appears partition even if original model is not #2373

Merged
merged 1 commit into from
Feb 26, 2025

Conversation

dgodinez-dh
Copy link
Contributor

https://deephaven.atlassian.net/browse/DH-18545

IrisGridProxyModel is a PartitionedGridModel and always returns true for isPartitionedGridModelProvider and isPartitionedGridModel.

This fix changes the proxy return values so those methods return false if they would return false for the original model.

Copy link

codecov bot commented Feb 26, 2025

Codecov Report

Attention: Patch coverage is 66.66667% with 1 line in your changes missing coverage. Please review.

Project coverage is 46.80%. Comparing base (35fc599) to head (e317a4e).

Files with missing lines Patch % Lines
packages/iris-grid/src/IrisGridProxyModel.ts 66.66% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff            @@
##             main    #2373    +/-   ##
========================================
  Coverage   46.80%   46.80%            
========================================
  Files         710      710            
  Lines       39224    39226     +2     
  Branches     9789     9975   +186     
========================================
+ Hits        18357    18358     +1     
- Misses      20856    20857     +1     
  Partials       11       11            
Flag Coverage Δ
unit 46.80% <66.66%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

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

@dgodinez-dh dgodinez-dh requested review from a team and vbabich and removed request for a team February 26, 2025 16:47
@@ -300,6 +301,10 @@ class IrisGridProxyModel extends IrisGridModel implements PartitionedGridModel {
!isPartitionedGridModelProvider(this.originalModel) ||
!this.originalModel.isPartitionRequired
) {
if (!isPartitionedGridModel(this.originalModel)) {
// @ts-expect-error If the original model has an undefined partitionConfig return undefined to make the proxy model also return false in isPartitionedGridModel
Copy link
Collaborator

Choose a reason for hiding this comment

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

Would it be difficult to change the return type instead of suppressing the error in partitionConfig and isPartitionRequired?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It could be changed, but I think it is correct as it is. A real PartitionedGridModel should never return undefined for these values, and I think code using a real PartitionedGridModel should not need to worry about checking for undefined.

@dgodinez-dh dgodinez-dh merged commit 8cc36a5 into deephaven:main Feb 26, 2025
11 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators Feb 26, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants