Skip to content

[PLT-1306][PLT-1307] Get project list add details part 1 #1770

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

Merged
merged 4 commits into from
Aug 16, 2024

Conversation

vbrodsky
Copy link
Contributor

@vbrodsky vbrodsky commented Aug 15, 2024

Description

Stories:
https://labelbox.atlassian.net/browse/PLT-1306
https://labelbox.atlassian.net/browse/PLT-1307

This API is first of 3 to implement support for Project / ProjectList labeling dashboard data in sdk

The spec is defined here https://docs.google.com/spreadsheets/d/17o_8uZMoPfIjNAFQsDx-UNCGYhifcx1mQIvCzMDcw50/edit?gid=0#gid=0

Follow up PR:

  • support remaining attributes
  • support filters for project list
  • more thorough e2e sdk integration test for aligners

Fixes # (issue)

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Document change (fix typo or modifying any markdown files, code comments or anything in the examples folder only)

All Submissions

  • Have you followed the guidelines in our Contributing document?
  • Have you provided a description?
  • Are your changes properly formatted?

New Feature Submissions

  • Does your submission pass tests?
  • Have you added thorough tests for your new feature?
  • Have you commented your code, particularly in hard-to-understand areas?
  • Have you added a Docstring?

Changes to Core Features

  • Have you written new tests for your core changes, as applicable?
  • Have you successfully run tests with your changes locally?
  • Have you updated any code comments, as applicable?

@vbrodsky vbrodsky requested a review from a team as a code owner August 15, 2024 23:46
@vbrodsky vbrodsky marked this pull request as draft August 15, 2024 23:46
@vbrodsky vbrodsky force-pushed the VB/get-project-list-details_PLT-1307 branch from 1ac021c to fc2e8df Compare August 16, 2024 03:33

Cuid = Annotated[str, Field(min_length=25, max_length=25)]


class LabelingServiceStatus(Enum):
Copy link
Contributor Author

Choose a reason for hiding this comment

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

move to a separate package

after: The cursor to use for pagination.
where: A filter to apply to the query.

NOTE: support for after and search_query are not yet implemented.
Copy link
Contributor Author

Choose a reason for hiding this comment

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

will implement in the next PR

@vbrodsky vbrodsky force-pushed the VB/get-project-list-details_PLT-1307 branch from fc2e8df to 0701c6d Compare August 16, 2024 03:35
GRAPHQL_QUERY_SELECTIONS = """
id
name
# serviceType
Copy link
Contributor Author

Choose a reason for hiding this comment

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

these are not supported by the api yet

@vbrodsky vbrodsky force-pushed the VB/get-project-list-details_PLT-1307 branch from 0701c6d to 33457ae Compare August 16, 2024 03:40
organization_id = client.get_organization().uid
query_str = template.substitute(
labeling_dashboard_selections=GRAPHQL_QUERY_SELECTIONS,
search_query=
Copy link
Contributor Author

Choose a reason for hiding this comment

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

for now a hard-coded filter. Next PR will implement dynamic filters

SetUp = 'SET_UP'
Missing = None

@classmethod
Copy link
Contributor Author

Choose a reason for hiding this comment

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

We duplicate this code amongst all enums. Made a note to make a reusable module

@vbrodsky vbrodsky force-pushed the VB/get-project-list-details_PLT-1307 branch from 33457ae to 77d86a3 Compare August 16, 2024 03:51
@vbrodsky vbrodsky marked this pull request as ready for review August 16, 2024 03:52
@vbrodsky vbrodsky force-pushed the VB/get-project-list-details_PLT-1307 branch 2 times, most recently from 7bdfe05 to cf39487 Compare August 16, 2024 17:28
@vbrodsky vbrodsky force-pushed the VB/get-project-list-details_PLT-1307 branch from cf39487 to 9865a60 Compare August 16, 2024 17:48
"""
result = client.execute(query, {"projectId": project_id})
if result["projectBoostWorkforce"] is None:
raise ResourceNotFoundError(
Copy link
Contributor

Choose a reason for hiding this comment

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

I know this is a defensive check, but is this even possible? Just curious

Copy link
Contributor Author

Choose a reason for hiding this comment

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

just a defensive check

@vbrodsky vbrodsky merged commit e20a774 into develop Aug 16, 2024
20 of 25 checks passed
@vbrodsky vbrodsky deleted the VB/get-project-list-details_PLT-1307 branch August 16, 2024 18:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants