load correct NotRequired if python < 3.11

This commit is contained in:
jasquat 2023-05-01 14:00:09 -04:00
parent 2dc61ec669
commit b85658e689
No known key found for this signature in database
3 changed files with 6 additions and 51 deletions

View File

@ -1191,20 +1191,6 @@ paths:
description: The page number to return. Defaults to page 1.
schema:
type: integer
# get:
# operationId: spiffworkflow_backend.routes.process_instances_controller.process_instance_report_show
# summary: Returns a report of process instances for a given process model
# tags:
# - Process Instances
# responses:
# "200":
# description: Workflow.
# content:
# application/json:
# schema:
# type: array
# items:
# $ref: "#/components/schemas/Workflow"
put:
operationId: spiffworkflow_backend.routes.process_instances_controller.process_instance_report_update
summary: Updates a process instance report

View File

@ -1,13 +1,17 @@
"""Process_instance."""
from __future__ import annotations
import sys
import typing
from dataclasses import dataclass
from typing import Any
from typing import cast
from typing import NotRequired
if sys.version_info < (3, 11):
from typing_extensions import TypedDict, NotRequired
else:
from typing import TypedDict, NotRequired
from typing import Optional
from typing import TypedDict
from sqlalchemy import ForeignKey
from sqlalchemy.orm import relationship

View File

@ -427,41 +427,6 @@ def process_instance_report_delete(
return Response(json.dumps({"ok": True}), status=200, mimetype="application/json")
# def process_instance_report_show(
# report_id: int,
# page: int = 1,
# per_page: int = 100,
# ) -> flask.wrappers.Response:
# """Process_instance_report_show."""
# process_instances = ProcessInstanceModel.query.order_by(
# ProcessInstanceModel.start_in_seconds.desc(), ProcessInstanceModel.id.desc() # type: ignore
# ).paginate(page=page, per_page=per_page, error_out=False)
#
# process_instance_report = ProcessInstanceReportModel.query.filter_by(
# id=report_id,
# created_by_id=g.user.id,
# ).first()
# if process_instance_report is None:
# raise ApiError(
# error_code="unknown_process_instance_report",
# message="Unknown process instance report",
# status_code=404,
# )
#
# substitution_variables = request.args.to_dict()
# result_dict = process_instance_report.generate_report(process_instances.items, substitution_variables)
#
# # update this if we go back to a database query instead of filtering in memory
# result_dict["pagination"] = {
# "count": len(result_dict["results"]),
# "total": len(result_dict["results"]),
# "pages": 1,
# }
#
# return Response(json.dumps(result_dict), status=200, mimetype="application/json")
#
def process_instance_task_list_without_task_data_for_me(
modified_process_model_identifier: str,
process_instance_id: int,