Skip to content

Commit

Permalink
fix(mypy): refine types (#8129)
Browse files Browse the repository at this point in the history
  • Loading branch information
rexledesma committed May 31, 2022
1 parent 35e8a66 commit 8f1d403
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
6 changes: 3 additions & 3 deletions python_modules/dagit/dagit/graphql.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from abc import ABC, abstractmethod
from asyncio import Queue, Task, get_event_loop
from enum import Enum
from typing import Any, AsyncGenerator, Dict, List, Optional, Tuple, Union
from typing import Any, AsyncGenerator, Dict, List, Optional, Tuple, Union, cast

from dagit.templates.playground import TEMPLATE
from graphene import Schema
Expand Down Expand Up @@ -108,7 +108,7 @@ async def graphql_http_endpoint(self, request: Request):
)

query = data.get("query")
variables = data.get("variables")
variables: Union[Optional[str], Dict[str, Any]] = data.get("variables")
operation_name = data.get("operationName")

if query is None:
Expand All @@ -119,7 +119,7 @@ async def graphql_http_endpoint(self, request: Request):

if isinstance(variables, str):
try:
variables = json.loads(variables)
variables = cast(Dict[str, Any], json.loads(variables))
except json.JSONDecodeError:
return PlainTextResponse(
f"Malformed GraphQL variables. Passed as string but not valid JSON:\n{variables}",
Expand Down
6 changes: 5 additions & 1 deletion python_modules/libraries/dagster-mlflow/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@ def get_version() -> str:
"Operating System :: OS Independent",
],
packages=find_packages(exclude=["dagster_mlflow_tests*"]),
install_requires=["dagster", "mlflow", "pandas"],
install_requires=[
"dagster",
"mlflow<=1.26.0", # https://github.com/mlflow/mlflow/issues/5968
"pandas",
],
zip_safe=False,
)

0 comments on commit 8f1d403

Please sign in to comment.