Skip to content

Commit

Permalink
Remove extra field from create endpoints (#12240)
Browse files Browse the repository at this point in the history
  • Loading branch information
urimandujano committed Mar 11, 2024
1 parent cccfc96 commit 91b0ac6
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 31 deletions.
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

0 comments on commit 91b0ac6

Please sign in to comment.