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

chore(server/deps): Upgrade to pydantic ^2.4.2 [TCTC-7241] #1891

Merged
merged 23 commits into from
Dec 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
c9d040a
chore: bump pydantic
lukapeschke Sep 12, 2023
2a607f8
chore: run bump-pydantic
lukapeschke Sep 12, 2023
8bfc83a
fix remaining warnings
lukapeschke Sep 12, 2023
b68e22f
fix tests
lukapeschke Sep 12, 2023
fdd5af8
Stop using deprectaed pydantic methods
lukapeschke Sep 12, 2023
f48d92e
fix lockfile
lukapeschke Sep 12, 2023
a5fac15
update connectors
lukapeschke Sep 15, 2023
9f370be
refactor: Annotate PipelineOrDomainName to support steps as models
lukapeschke Sep 15, 2023
85e3560
Merge branch 'master' into upgrade-pydantic
lukapeschke Sep 28, 2023
0908533
bump pydandic ^2.4.2
lukapeschke Sep 29, 2023
9e0875b
refactor: force RelativeDate.date to be a datetime instance
lukapeschke Sep 29, 2023
9a2ac9d
Merge branch 'master' into upgrade-pydantic
lukapeschke Nov 22, 2023
3210283
updated connectors branch
lukapeschke Nov 23, 2023
1b1f9f0
fix: Add missing python-dateutil dependency
lukapeschke Nov 23, 2023
186a0bb
Merge branch 'master' into upgrade-pydantic
lukapeschke Dec 4, 2023
6a62bf1
fix: forbid PipelineStepWithRefs in PipelineWithVariables
lukapeschke Dec 6, 2023
c0665f5
feat(server): drop Python 3.10 support
lukapeschke Dec 7, 2023
2582ed4
refactor(server/combination): Allow PipelineOrDomainName to be a list…
lukapeschke Dec 7, 2023
c358026
refactor(server): replace update_forward_refs() with model_rebuild()
lukapeschke Dec 7, 2023
052b713
refactor(server): Stronger typing on pipelineOrDomainName
lukapeschke Dec 7, 2023
31a799b
fix(server): temporary fix for the discriminated union bug
lukapeschke Dec 7, 2023
69e8d9e
fix PipelineWithRefs typing
lukapeschke Dec 7, 2023
afe7a05
bump connectors
lukapeschke Dec 15, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci-server.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
strategy:
fail-fast: true
matrix:
python-version: ['3.10', '3.11']
python-version: ['3.11']

defaults:
run:
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ COPY playground/dist /weaverbird/playground/dist
RUN yarn build


FROM python:3.10 as server
FROM python:3.11 as server

WORKDIR /weaverbird/server

Expand Down
7 changes: 7 additions & 0 deletions server/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# Changelog (weaverbird python package)

## Unreleased

## Breaking

- Dropped support for Python 3.10
- Bumped `pydantic` minimum version from 1.x to 2.4.2

## [0.39.0] - 2023-10-16

### Added
Expand Down
23 changes: 11 additions & 12 deletions server/playground.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,7 @@
from weaverbird.backends.pypika_translator.translate import (
translate_pipeline as pypika_translate_pipeline,
)
from weaverbird.pipeline.pipeline import Pipeline
from weaverbird.pipeline.references import PipelineWithRefs
from weaverbird.pipeline.pipeline import Pipeline, PipelineWithRefs
from weaverbird.pipeline.steps import DomainStep
from weaverbird.pipeline.steps.utils.combination import Reference

Expand Down Expand Up @@ -179,7 +178,7 @@ async def execute_pipeline(pipeline: Pipeline, **kwargs) -> str:
limit=output.pop("limit"),
total_rows=output.pop("total"),
retrieved_rows=len(output["data"]),
).dict()
).model_dump()

return json.dumps(
{
Expand All @@ -206,7 +205,7 @@ async def handle_pandas_backend_request():
return (
jsonify(
{
"step": e.step.dict(),
"step": e.step.model_dump(),
"index": e.index,
"message": e.message,
}
Expand Down Expand Up @@ -346,7 +345,7 @@ def execute_mongo_aggregation_query(collection, query, limit, offset):


async def dummy_reference_resolver(r: Reference) -> list[dict]:
return [DomainStep(domain=r.uid).dict()]
return [DomainStep(domain=r.uid).model_dump()]


@app.route("/mongo", methods=["GET", "POST"])
Expand Down Expand Up @@ -379,7 +378,7 @@ async def handle_mongo_backend_request():

return jsonify(
{
"pagination_info": pagination_info.dict(),
"pagination_info": pagination_info.model_dump(),
"data": results["data"],
"types": results["types"],
"query": mongo_query, # provided for inspection purposes
Expand All @@ -406,7 +405,7 @@ async def handle_mongo_translated_backend_request():

return jsonify(
{
"pagination_info": pagination_info.dict(),
"pagination_info": pagination_info.model_dump(),
"data": results["data"],
"types": results["types"],
"query": req_params["query"], # provided for inspection purposes
Expand Down Expand Up @@ -519,7 +518,7 @@ async def handle_snowflake_backend_request():
limit=limit,
retrieved_rows=len(df_results),
total_rows=total_count,
).dict(),
).model_dump(),
"schema": build_table_schema(df_results, index=False),
"data": json.loads(df_results.to_json(orient="records")),
"query": query, # provided for inspection purposes
Expand Down Expand Up @@ -637,7 +636,7 @@ async def handle_postgres_backend_request():
limit=limit,
retrieved_rows=len(query_results_page),
total_rows=query_total_count,
).dict(),
).model_dump(),
"results": {
"headers": query_results_columns,
"data": query_results_page,
Expand Down Expand Up @@ -699,7 +698,7 @@ async def handle_athena_post_request():
return {
"pagination_info": build_pagination_info(
offset=offset, limit=limit, retrieved_rows=len(result), total_rows=None
).dict(),
).model_dump(),
"results": {
"headers": result.columns.to_list(),
"data": json.loads(result.to_json(orient="records")),
Expand Down Expand Up @@ -767,7 +766,7 @@ async def hangle_bigquery_post_request():
return {
"pagination_info": build_pagination_info(
offset=offset, limit=limit, retrieved_rows=len(result), total_rows=None
).dict(),
).model_dump(),
"results": {
"headers": result.columns.to_list(),
"data": json.loads(result.to_json(orient="records")),
Expand Down Expand Up @@ -834,7 +833,7 @@ async def handle_mysql_post_request():
return {
"pagination_info": build_pagination_info(
offset=offset, limit=limit, retrieved_rows=len(result), total_rows=None
).dict(),
).model_dump(),
"results": {
"headers": result.columns.to_list(),
"data": json.loads(result[offset : offset + limit].to_json(orient="records")),
Expand Down
Loading
Loading