Conversation
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 6 out of 6 changed files in this pull request and generated 3 comments.
Comments suppressed due to low confidence (1)
vortexasdk/api/fixture.py:26
- Renaming the
Fixturefield fromtonestotonnesis a breaking change for SDK consumers who may still accessfixture.tones. Consider keeping a deprecated alias property so existing code keeps working while the correct field name is used going forward.
id: ID
vessel: Optional[VesselEntity] = None
laycan_from: Optional[str] = None
laycan_to: Optional[str] = None
tonnes: Optional[int] = None
fixing_timestamp: Optional[str] = None
vtx_fulfilled: Optional[bool] = None
origin: Optional[Entity] = None
destination: Optional[Entity] = None
product: Optional[Entity] = None
charterer: Optional[Entity] = None
| """Convert nested `Fixture` object to flat dictionary, keeping *cols*.""" | ||
| as_dict = _group_fixture_attributes_by_layer(fixture) | ||
|
|
||
| formatted = flatten_dictionary(as_dict) |
There was a problem hiding this comment.
Would appreciate some input on this. I think because changing to tonnes could be a breaking change it is doing this to make sure that people don't have to modify anything but idk if that's a good practice
|
|
|
@jack-bliss ya that makes sense. although thinking about it, if it was already broken before we'd be making a breaking change to something that was already broken so maybe it'd be fine? idk if that's a valid thought |
|
Verified: Jack and I (Claude) tested the current
No customer could have been relying on |
|
It is kinda confusing tho since to_list was populating tonnes despite the spelling mistake. Claude said it has something to do with Pydantic accepting tones as tonnes but I couldn't find where. I think the to_df() was handled differently and that's why there were issues with it |
|
Also verified: Same approach — Jack and I (Claude) tested the current df = Fixtures().search(...).to_df(columns=[
'vessel.name', 'vessel.imo', 'vessel.corporate_entities.0.label',
'vessels.name', 'vessels.imo', 'vessels.corporate_entities.0.label',
])Results: The API returns |
this isn't what i've found when running against master - can you show an example of it working? |
|
Oh wait yeah you're right, it doesn't work. The ticket says people currently use to_list() instead of to_df() since the to_df() functionality isn't working, but I guess not since to_list() is also cooked |
RELATED TICKETS
https://vortexa.atlassian.net/jira/software/c/projects/RND/boards/465?selectedIssue=RND-21448
! Do not post related PRs here, unless they are open source !
CHANGELOG
convert_fixture_to_flat_dictto groupvessel.corporate_entitiesby layer name before flatteningtones→tonnestypo in model, DEFAULT_COLUMNS, and docstringsTESTS
vessel.corporate_entities.effective_controller.labelandtime_charterer.labelnow populate correctly into_df(), along with other fields. Has the ability to fill 'vessel.corporate_entities.effective_controller.label' which by definition exists in the schema, and if it exists like ticket says, but across all the fixtures it doesn't existpytest -v tests/endpoints/test_fixtures_real.py
pytest -v tests/api/test_fixture_flattening.py
COMMENTS
vessels.corporate_entities.charterer.labelbut the API returnsvessel(singular) and never includeschartererincorporate_entities, only at root level