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(persistence): get or delete projects using sql #2839

Merged
merged 14 commits into from
Apr 12, 2024

Conversation

RogerHYang
Copy link
Contributor

resolves #2838

@dosubot dosubot bot added the size:L This PR changes 100-499 lines, ignoring generated files. label Apr 10, 2024
@RogerHYang RogerHYang linked an issue Apr 10, 2024 that may be closed by this pull request
Copy link
Contributor

@mikeldking mikeldking left a comment

Choose a reason for hiding this comment

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

Let some comments. A tad confused by the indexes....

src/phoenix/core/traces.py Outdated Show resolved Hide resolved
src/phoenix/core/traces.py Outdated Show resolved Hide resolved
src/phoenix/core/traces.py Outdated Show resolved Hide resolved
src/phoenix/server/api/schema.py Show resolved Hide resolved
src/phoenix/core/traces.py Outdated Show resolved Hide resolved
Copy link
Contributor

@axiomofjoy axiomofjoy left a comment

Choose a reason for hiding this comment

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

  • Are indexes created anonymously able to be migrated?
  • I think you can remove the projects table from one more query.

Project(
id_attr=project.id,
name=project.name,
project=info.context.traces.get_project(project.name), # type: ignore
Copy link
Contributor

Choose a reason for hiding this comment

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

As a follow-up, it might make sense to key the core projects by ID rather than name.

Copy link
Contributor Author

@RogerHYang RogerHYang Apr 12, 2024

Choose a reason for hiding this comment

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

the (in-memory) core projects will be deleted after migration, so this is moot.

src/phoenix/server/api/schema.py Show resolved Hide resolved
src/phoenix/server/api/schema.py Show resolved Hide resolved
sa.Integer,
sa.ForeignKey("projects.id", ondelete="CASCADE"),
nullable=False,
index=True,
Copy link
Contributor

Choose a reason for hiding this comment

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

Are these indexes anonymous? Do we need to explicitly name them in order to run migrations on them?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

They're named automatically.

Screenshot 2024-04-12 at 10 29 35 AM

src/phoenix/server/api/types/Project.py Outdated Show resolved Hide resolved
@RogerHYang RogerHYang merged commit 527b9a9 into sql Apr 12, 2024
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size:L This PR changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[persistence] get or delete projects using sql
3 participants