GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||||||||||||||||||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||||||||||||||||||||||||||||||||||||||||||
GeezerVison is showing github.com — fix: raise exception when type of DocList is object by punndcoder28 · Pull Request #1794 · docarray/docarray
This repository was archived by the owner on Sep 9, 2026. It is now read-only.
Conversation
Contributor
Test Plan - Running the below code raises exception Exception raise
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
punndcoder28
commented
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. added a check
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
punndcoder28
marked this pull request as ready for review
Contributor
Author
All reactions
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page.
|
There was an error while loading. Please reload this page.
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@ ## main #1794 +/- ## ========================================== + Coverage 84.24% 84.81% +0.56% ========================================== Files 135 135 Lines 8899 8901 +2 ========================================== + Hits 7497 7549 +52 + Misses 1402 1352 -50
Flags with carried forward coverage won't be shown. Click here to find out more.
☔ View full report in Codecov by Sentry. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Hey @punndcoder28, please make sure to add relevant tests for this |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
08b7e7b to
8621817
Compare
| return AnyDocArray.__class_getitem__.__func__(cls, item) # type: ignore | ||
| else: | ||
| return super().__class_getitem__(item) | ||
| if ( |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
should we better have an elif?
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Since each condition has a terminating condition from the function wouldn't multiple if's be similar to elif? If there was a scenario like below an elif would definitely make it much better. In the above case, we check the instance of item and based on the condition we return a type or raise an exception. But if the code base follows if ... elif ... else blocks I would love to keep it uniform so that it is easy to maintain
computation
if condn1:
computation = value1
elif condn2:
computation = value2
else:
computation = value3
return computation
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Will fix the failing tests related to new changes |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
@JoanFM Can we pass string literal as types for a class? Like so This is being done here docarray/tests/units/array/test_array.py Line 383 in 8f32866
|
Sorry, something went wrong.
There was an error while loading. Please reload this page.
2144b3c to
1a727be
Compare
u can in the type hints |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Signed-off-by: punndcoder28 <[email protected]>
1a727be to
8266238
Compare
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
Bug with DocList[]
There was an error while loading. Please reload this page.