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

Remove extra field from create endpoints #12240

Merged
merged 3 commits into from
Mar 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
1 change: 0 additions & 1 deletion src/prefect/server/schemas/actions.py
Original file line number Diff line number Diff line change
Expand Up @@ -434,7 +434,6 @@ class FlowRunCreate(ActionBaseModel):
),
deprecated=True,
)
job_variables: Optional[Dict[str, Any]] = FieldFrom(schemas.core.FlowRun)

class Config(ActionBaseModel.Config):
json_dumps = orjson_dumps_extra_compatible
Expand Down
18 changes: 0 additions & 18 deletions tests/server/api/test_flow_runs.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,24 +49,6 @@ async def test_create_flow_run(self, flow, client, session):
)
assert flow_run.flow_id == flow.id

async def test_create_flow_run_with_job_variables(self, flow, client, session):
job_vars = {"key": "value"}
response = await client.post(
"/flow_runs/",
json=actions.FlowRunCreate(
flow_id=flow.id,
name="",
job_variables=job_vars,
).dict(json_compatible=True),
)
assert response.status_code == status.HTTP_201_CREATED
assert response.json()["job_variables"] == job_vars

flow_run = await models.flow_runs.read_flow_run(
session=session, flow_run_id=response.json()["id"]
)
assert flow_run.job_variables == job_vars

async def test_create_flow_run_with_infrastructure_document_id(
self, flow, client, infrastructure_document_id
):
Expand Down
12 changes: 0 additions & 12 deletions tests/server/models/test_flow_runs.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,6 @@ async def test_create_flow_run(self, flow, session):
)
assert flow_run.flow_id == flow.id

@pytest.mark.parametrize("job_vars", [{}, None, {"foo": "bar"}])
async def test_create_flow_run_with_job_variables(
self, flow, session, job_vars: dict
):
flow_run = await models.flow_runs.create_flow_run(
session=session,
flow_run=schemas.core.FlowRun(flow_id=flow.id, job_variables=job_vars),
)

expected = {} if job_vars is None else job_vars
assert flow_run.job_variables == expected

async def test_create_flow_run_with_infrastructure(
self, flow, session, infrastructure_document_id
):
Expand Down