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: incorporate schema for postgresql and add integration test #4474

Merged
merged 5 commits into from
Sep 3, 2024

Conversation

RogerHYang
Copy link
Contributor

resolves #4212
resolves #4302

@dosubot dosubot bot added the size:XL This PR changes 500-999 lines, ignoring generated files. label Sep 3, 2024
Copy link
Contributor Author

Choose a reason for hiding this comment

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

copied from #4470

# Applying this workaround: https://github.com/actions/runner/issues/822
image: ${{ (matrix.os == 'ubuntu-latest') && 'postgres:12' || '' }}
env:
POSTGRES_PASSWORD: phoenix
Copy link
Contributor Author

Choose a reason for hiding this comment

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

setting a distinct password to avoid making inadvertent connections when running locally

Comment on lines +134 to +140
def set_postgresql_search_path(schema: str) -> Callable[[Connection, Any], None]:
def _(connection: Connection, _: Any) -> None:
cursor = connection.cursor()
cursor.execute(f"CREATE SCHEMA IF NOT EXISTS {schema};")
cursor.execute(f"SET search_path TO {schema};")

return _
Copy link
Contributor

Choose a reason for hiding this comment

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

what happens if the schema is set after you've already bootstrapped the DB?

Copy link
Contributor Author

@RogerHYang RogerHYang Sep 3, 2024

Choose a reason for hiding this comment

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

it'll be created as a new one: that's how the integration tests work

src/phoenix/config.py Outdated Show resolved Hide resolved
@RogerHYang RogerHYang merged commit cd64a99 into main Sep 3, 2024
15 checks passed
@RogerHYang RogerHYang deleted the postgresql-schema-search-path branch September 3, 2024 19:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size:XL This PR changes 500-999 lines, ignoring generated files.
Projects
None yet
2 participants