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: Shadow size property of columns object, so it acts as a column #1855

Merged
merged 1 commit into from
Dec 14, 2023

Conversation

effigies
Copy link
Collaborator

@effigies effigies commented Dec 7, 2023

Fixes #1824. This is a narrow fix for the size column. I believe the other things that could potentially be shadowed are:

  • length
  • entries
  • keys
  • hasOwnProperty
  • constructor
  • prototype
  • toString

length is the only one that seems plausible to eventually have as a header, but it is not defined in BIDS, so I'm inclined to leave it alone for now.

I add a test that size is permissible and returns a column if present and returns undefined like other absent columns if absent.

@effigies effigies added the schema label Dec 7, 2023
Copy link

codecov bot commented Dec 7, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (934c857) 85.97% compared to head (ac49a6e) 83.57%.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1855      +/-   ##
==========================================
- Coverage   85.97%   83.57%   -2.40%     
==========================================
  Files         131       92      -39     
  Lines        6268     3897    -2371     
  Branches     1527     1273     -254     
==========================================
- Hits         5389     3257    -2132     
+ Misses        772      542     -230     
+ Partials      107       98       -9     

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

@effigies
Copy link
Collaborator Author

effigies commented Dec 7, 2023

This seems to be causing leaks:

valid_dataset dataset ... completes validation => ./src/tests/local/common.ts:26:11
error: Leaking async ops:
  - 2 async operations to op_read were started in this test, but never completed.
To get more details where ops were leaked, run again with --trace-ops flag.

valid_dataset dataset ... correctly ignores .bidsignore files => ./src/tests/local/valid_dataset.test.ts:10:11
error: Leaking resources:
  - A file (rid 400) was opened before the test started, but was closed during the test. Do not close resources in a test that were not created during that test.
  - A file (rid 401) was opened before the test started, but was closed during the test. Do not close resources in a test that were not created during that test.

valid_filenames dataset ... completes validation => ./src/tests/local/common.ts:26:11
error: Leaking async ops:
  - 2 async operations to op_read were started in this test, but never completed.
To get more details where ops were leaked, run again with --trace-ops flag.

valid_filenames dataset ... correctly ignores .bidsignore files => ./src/tests/local/valid_filenames.test.ts:10:11
error: Leaking resources:
  - A file (rid 37) was opened before the test started, but was closed during the test. Do not close resources in a test that were not created during that test.
  - A file (rid 38) was opened before the test started, but was closed during the test. Do not close resources in a test that were not created during that test.

valid_headers dataset ... completes validation => ./src/tests/local/common.ts:26:11
error: Test failed
error: Leaking async ops:
  - 1 async operation to op_read was started in this test, but never completed.
To get more details where ops were leaked, run again with --trace-ops flag.

valid_headers dataset ... correctly ignores .bidsignore files => ./src/tests/local/valid_headers.test.ts:10:11
error: Leaking resources:
  - A file (rid 31) was opened before the test started, but was closed during the test. Do not close resources in a test that were not created during that test.

@effigies
Copy link
Collaborator Author

@rwblair @nellh I was wrong, those leaking resources are not related to this PR but are happening in master. I think this is good to go, but we've got a separate problem on our hands.

@rwblair rwblair merged commit f52eec4 into bids-standard:master Dec 14, 2023
25 of 29 checks passed
@effigies effigies deleted the fix/shadow-columns-size branch December 14, 2023 15:40
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.

ColumnMap errors if key is in prototypes.
2 participants