-
Notifications
You must be signed in to change notification settings - Fork 41
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
[IO-1278][IO-1277] Core Items/Folders apis #691
Conversation
IO-1278 Core: Retrieve Items
Create methods for:
|
darwin/future/meta/objects/stage.py
Outdated
return [ | ||
[edge.id, edge.source_stage_id, edge.target_stage_id] | ||
for edge in self._element.edges | ||
if edge.source_stage_id and edge.target_stage_id | ||
] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@JBWilkie source_stage_id and target_stage_id are optional so they can be None. Which means this comprehension without the if check actually returns a List[List[UUID | None]]. Let me know if this change doesn't make sense though and you want the None's
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can't see a use case for why the None
s would be needed but you never know
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I actually changed this so that it returns the WFEdgeCore
items instead of the IDs within them, not sure why I didn't do this originally
This means we don't need to worry about this if check
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking good, hold off merge until we've worked out data structs in call later, and potentially until @JBWilkie responds on the points about none filtering, although I don't think that's as blocking.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like this stuff especially 😉
return v | ||
|
||
|
||
class ItemSlot(DefaultDarwin): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the main one I've changed in my branch
|
||
|
||
class Item(DefaultDarwin): | ||
name: str |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And this is where we'll have to figure it out between us.
@pytest.fixture | ||
def base_items_json(base_items: List[Item]) -> List[dict]: | ||
items = [item.dict() for item in base_items] | ||
# json library doesn't support UUIDs so need to be str'd |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, what's with this? Every time I hit this, I'm tempted to write:
class JsonableUUID(UUID):
...fix for this...
darwin/future/meta/objects/stage.py
Outdated
return [ | ||
[edge.id, edge.source_stage_id, edge.target_stage_id] | ||
for edge in self._element.edges | ||
if edge.source_stage_id and edge.target_stage_id | ||
] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can't see a use case for why the None
s would be needed but you never know
Problem
No ability to retrieve or manage items and folders
Solution
Changelog
Beggining of support for items object, including apis