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

feat: allow project_id to be optional in projection class #78

Merged
merged 16 commits into from
Sep 26, 2024

Conversation

rguo123
Copy link
Contributor

@rguo123 rguo123 commented Sep 23, 2024

First pass at making project_id optional in projection class.
When fetching anything that requires project_id, check to see if undefined, if so, fetch it from atlas_cloud endpoint.

Needs to be timed with prod deploy of atlas_cloud that introduces this route
https://github.com/nomic-ai/atlas_cloud/pull/1812


Important

Make project_id optional in AtlasProjection, add datasetId() to fetch it if undefined, update methods, add tests, and coordinate with prod deploy.

  • Behavior:
    • Make project_id optional in AtlasProjection class.
    • Add datasetId() method to fetch project_id if undefined.
    • Remove error for missing project_id in constructor.
    • Update getTags(), getTagStatus(), updateTagMask(), and project() to use datasetId().
  • Testing:
    • Add test in project.test.js to verify datasetId() fetches project_id correctly.
  • Misc:
    • Bump version in package.json from 0.11.0 to 0.11.1.
    • Coordinate with prod deploy of atlas_cloud for new route.

This description was created by Ellipsis for 1863ca2. It will automatically update as commits are pushed.

package.json Outdated Show resolved Hide resolved
src/projection.ts Outdated Show resolved Hide resolved
Copy link
Collaborator

@bmschmidt bmschmidt left a comment

Choose a reason for hiding this comment

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

Couple small issues, looks generally good.

Copy link
Collaborator

RLesser commented Sep 25, 2024

When you merge this in, let's prefix the squashed commit with refactor: or feat:, as we're trying to adhere to semantic versioning

@rguo123 rguo123 changed the title [RFR] Allow optional project_id on projection class feat: allow project_id to be optional in projection class Sep 25, 2024
@rguo123 rguo123 requested a review from bmschmidt September 25, 2024 14:55
src/projection.ts Outdated Show resolved Hide resolved
src/projection.ts Outdated Show resolved Hide resolved
@rguo123 rguo123 force-pushed the optional-project-id branch from 4655dbb to 306319f Compare September 26, 2024 14:50
return this._project_id_promise;
}

this._project_id_promise = this.apiCall(endpoint, 'GET').then(
Copy link
Contributor

Choose a reason for hiding this comment

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

Consider adding retry logic for the API call to handle transient errors and improve robustness.

@bmschmidt bmschmidt merged commit e82b9da into main Sep 26, 2024
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.

3 participants