Skip to content

Commit

Permalink
fix type errors [INTERNAL_BRANCH=sean/pyright-pins]
Browse files Browse the repository at this point in the history
  • Loading branch information
smackesey committed Feb 5, 2024
1 parent fac5e18 commit a247a1a
Show file tree
Hide file tree
Showing 51 changed files with 242 additions and 208 deletions.
2 changes: 1 addition & 1 deletion docs/content/integrations/embedded-elt.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ sling_job = build_assets_job(
This is an example of how to setup a Sling sync between Postgres and Snowflake:

```python file=/integrations/embedded_elt/postgres_snowflake.py
# pyright: reportGeneralTypeIssues=none
# pyright: reportCallIssue=none
# pyright: reportOptionalMemberAccess=none

import os
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@ class CredentialsResource(ConfigurableResource):
password: str

defs = Definitions(
assets=..., # type: ignore
assets=...,
resources={
"credentials": CredentialsResource(
username=EnvVar("MY_USERNAME"),
Expand Down Expand Up @@ -375,7 +375,7 @@ def query(self, query: str):

engine = create_engine(...)
defs = Definitions(
assets=..., # type: ignore
assets=...,
resources={"db": DBResource(engine=engine)},
)

Expand Down Expand Up @@ -475,7 +475,7 @@ def wrapped_io_manager(self) -> IOManagerDefinition:
return old_file_io_manager

defs = Definitions(
assets=..., # type: ignore
assets=...,
resources={
"io_manager": MyIOManager(base_path="/tmp/"),
},
Expand Down Expand Up @@ -553,7 +553,7 @@ def load_input(self, context: InputContext):
return read_csv(self._get_path(context.asset_key))

defs = Definitions(
assets=..., # type: ignore
assets=...,
resources={"io_manager": MyIOManager(root_path="/tmp/")},
)

Expand Down Expand Up @@ -669,7 +669,7 @@ class DBConnection:
def query(self, body: str):
...

@contextmanager
@contextmanager # type: ignore
def get_database_connection(username: str, password: str):
...

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -167,12 +167,12 @@ def average_age(config: MyNestedConfig):
"Alice": UserData(
age=10,
email="[email protected]",
profile_picture_url=..., # type: ignore
profile_picture_url=...,
),
"Bob": UserData(
age=20,
email="[email protected]",
profile_picture_url=..., # type: ignore
profile_picture_url=...,
),
}
)
Expand Down Expand Up @@ -403,7 +403,7 @@ def required_config() -> None:
class MyAssetConfig(Config):
# ellipsis indicates that even though the type is Optional,
# an input is required
person_first_name: Optional[str] = ... # type: ignore
person_first_name: Optional[str] = ...

# ellipsis can also be used with pydantic.Field to attach metadata
person_last_name: Optional[Callable] = Field(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# pyright: reportGeneralTypeIssues=none
# pyright: reportAttributeAccessIssue=none

# start
from dagster_duckdb_pyspark import DuckDBPySparkIOManager
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# pyright: reportGeneralTypeIssues=none
# pyright: reportCallIssue=none
# pyright: reportOptionalMemberAccess=none

import os
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# pyright: reportGeneralTypeIssues=none
# pyright: reportCallIssue=none
# pyright: reportOptionalMemberAccess=none

import os
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# pyright: reportGeneralTypeIssues=none
# pyright: reportInvalidTypeForm=none

# Disable reportGeneralTypeIssues here due to use of Dagster types in annotations
# Disable reportInvalidTypeForm here due to use of Dagster types in annotations

import typing

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,9 @@ def _get_item_timestamp(item_id):
min_item_id = hn_client.min_item_id()

start_id = binary_search_nearest_left(_get_item_timestamp, min_item_id, max_item_id, start)
end_id = binary_search_nearest_right(_get_item_timestamp, min_item_id, max_item_id, end)
end_id = check.not_none(
binary_search_nearest_right(_get_item_timestamp, min_item_id, max_item_id, end)
)

start_timestamp = str(datetime.fromtimestamp(_get_item_timestamp(start_id), tz=timezone.utc))
end_timestamp = str(datetime.fromtimestamp(_get_item_timestamp(end_id), tz=timezone.utc))
Expand Down
28 changes: 14 additions & 14 deletions pyright/alt-1/requirements-pinned.txt
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ botocore==1.34.27
buildkite-test-collector==0.1.7
cachetools==5.3.2
caio==0.9.13
certifi==2023.11.17
certifi==2024.2.2
cffi==1.16.0
charset-normalizer==3.3.2
click==8.1.7
Expand Down Expand Up @@ -59,7 +59,7 @@ cycler==0.12.1
-e python_modules/libraries/dagster-snowflake-pyspark
-e python_modules/libraries/dagster-spark
-e python_modules/dagster-webserver
dbt-core==1.7.6
dbt-core==1.7.7
dbt-duckdb==1.7.1
dbt-extractor==0.5.1
dbt-semantic-interfaces==0.4.3
Expand All @@ -82,7 +82,7 @@ fqdn==1.5.1
frozenlist==1.4.1
fsspec==2023.12.2
gcsfs==2023.12.2.post1
google-api-core==2.16.0
google-api-core==2.16.1
google-auth==2.27.0
google-auth-oauthlib==1.2.0
google-cloud-core==2.4.1
Expand All @@ -94,17 +94,17 @@ gql==3.5.0
graphene==3.3
graphql-core==3.2.3
graphql-relay==3.2.0
grpcio==1.60.0
grpcio-health-checking==1.60.0
grpcio-tools==1.60.0
grpcio==1.60.1
grpcio-health-checking==1.60.1
grpcio-tools==1.60.1
h11==0.14.0
httptools==0.6.1
humanfriendly==10.0
idna==3.6
importlib-metadata==6.11.0
iniconfig==2.0.0
ipykernel==6.29.0
ipython==8.20.0
ipython==8.21.0
isodate==0.6.1
isoduration==20.11.0
isort==5.13.2
Expand Down Expand Up @@ -144,7 +144,7 @@ mock==3.0.5
more-itertools==10.2.0
morefs==0.2.0
msgpack==1.0.7
multidict==6.0.4
multidict==6.0.5
multimethod==1.11
mypy==1.8.0
mypy-extensions==1.0.0
Expand All @@ -169,7 +169,7 @@ pandocfilters==1.5.1
parsedatetime==2.6
parso==0.8.3
pathspec==0.11.2
pendulum==2.1.2
pendulum==3.0.0
pexpect==4.9.0
pillow==10.2.0
platformdirs==3.11.0
Expand All @@ -184,7 +184,7 @@ ptyprocess==0.7.0
pure-eval==0.2.2
py==1.11.0
py4j==0.10.9.7
pyarrow==10.0.1
pyarrow==15.0.0
pyasn1==0.5.1
pyasn1-modules==0.3.0
pycparser==2.21
Expand All @@ -207,10 +207,9 @@ pytest-xdist==3.3.1
python-dateutil==2.8.2
python-dotenv==1.0.1
python-json-logger==2.0.7
python-slugify==8.0.2
python-slugify==8.0.3
pytimeparse==1.1.8
pytz==2023.4
pytzdata==2020.1
pytz==2024.1
PyYAML==6.0.1
pyzmq==25.1.2
referencing==0.33.0
Expand All @@ -232,7 +231,7 @@ Send2Trash==1.8.2
six==1.16.0
slack_sdk==3.26.2
sniffio==1.3.0
snowflake-connector-python==3.4.1
snowflake-connector-python==3.7.0
snowflake-sqlalchemy==1.5.1
sortedcontainers==2.4.0
soupsieve==2.5
Expand All @@ -246,6 +245,7 @@ tabulate==0.9.0
terminado==0.18.0
text-unidecode==1.3
threadpoolctl==3.2.0
time-machine==2.13.0
tinycss2==1.2.1
toml==0.10.2
tomli==2.0.1
Expand Down
41 changes: 20 additions & 21 deletions pyright/master/requirements-pinned.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ apache-airflow-providers-http==4.1.0
apache-airflow-providers-imap==3.5.0
apache-airflow-providers-sqlite==3.7.0
apeye==1.4.1
apeye-core==1.1.4
apeye-core==1.1.5
apispec==6.4.0
appdirs==1.4.4
appnope==0.1.3
Expand Down Expand Up @@ -57,18 +57,18 @@ bitmath==1.3.3.1
bleach==6.1.0
blinker==1.7.0
bokeh==3.3.4
boto3==1.34.30
botocore==1.34.30
boto3==1.34.33
botocore==1.34.33
buildkite-test-collector==0.1.7
CacheControl==0.13.1
CacheControl==0.14.0
cached-property==1.5.2
cachelib==0.9.0
cachetools==5.3.2
caio==0.9.13
callee==0.3.1
cattrs==23.2.3
celery==5.3.6
certifi==2023.11.17
certifi==2024.2.2
cffi==1.16.0
cfn-lint==0.85.0
chardet==5.2.0
Expand Down Expand Up @@ -219,8 +219,8 @@ fsspec==2023.12.2
future==0.18.3
gitdb==4.0.11
GitPython==3.1.41
google-api-core==2.16.0
google-api-python-client==2.115.0
google-api-core==2.16.1
google-api-python-client==2.116.0
google-auth==2.27.0
google-auth-httplib2==0.2.0
google-auth-oauthlib==1.2.0
Expand All @@ -238,10 +238,10 @@ graphql-core==3.2.3
graphql-relay==3.2.0
graphviz==0.20.1
great-expectations==0.17.11
grpcio==1.60.0
grpcio-health-checking==1.60.0
grpcio-status==1.60.0
grpcio-tools==1.60.0
grpcio==1.60.1
grpcio-health-checking==1.60.1
grpcio-status==1.60.1
grpcio-tools==1.60.1
gunicorn==21.2.0
h11==0.14.0
hologram==0.0.16
Expand All @@ -259,7 +259,7 @@ importlib-resources==6.1.1
inflection==0.5.1
iniconfig==2.0.0
ipykernel==6.29.0
ipython==8.20.0
ipython==8.21.0
ipython-genutils==0.2.0
ipywidgets==8.1.1
iso8601==2.1.0
Expand Down Expand Up @@ -329,7 +329,7 @@ mpmath==1.3.0
msal==1.26.0
msal-extensions==1.1.0
msgpack==1.0.7
multidict==6.0.4
multidict==6.0.5
multimethod==1.11
mypy-extensions==1.0.0
mypy-protobuf==3.5.0
Expand All @@ -351,7 +351,7 @@ oauthlib==3.2.2
objgraph==3.6.0
onnx==1.15.0
onnxconverter-common==1.13.0
onnxruntime==1.16.3
onnxruntime==1.17.0
openapi-schema-validator==0.6.2
openapi-spec-validator==0.7.1
opentelemetry-api==1.22.0
Expand Down Expand Up @@ -406,7 +406,7 @@ pure-eval==0.2.2
py==1.11.0
py-partiql-parser==0.5.0
py4j==0.10.9.7
pyarrow==10.0.1
pyarrow==15.0.0
pyarrow-hotfix==0.6
pyasn1==0.5.1
pyasn1-modules==0.3.0
Expand Down Expand Up @@ -438,7 +438,7 @@ python-jose==3.3.0
python-json-logger==2.0.7
python-multipart==0.0.6
python-nvd3==0.15.0
python-slugify==8.0.2
python-slugify==8.0.3
python-utils==3.8.2
pytimeparse==1.1.8
pytz==2023.4
Expand Down Expand Up @@ -468,7 +468,7 @@ scikit-learn==1.4.0
scipy==1.12.0
scrapbook==0.5.0
seaborn==0.13.2
selenium==4.17.1
selenium==4.16.0
Send2Trash==1.8.2
sending==0.3.0
sentry-sdk==1.40.0
Expand All @@ -481,7 +481,7 @@ sling==1.0.72
smmap==5.0.1
sniffio==1.3.0
snowballstemmer==2.2.0
snowflake-connector-python==3.4.1
snowflake-connector-python==3.7.0
snowflake-sqlalchemy==1.5.1
sortedcontainers==2.4.0
soupsieve==2.5
Expand Down Expand Up @@ -549,14 +549,13 @@ types-pyOpenSSL==24.0.0.20240130
types-python-dateutil==2.8.19.20240106
types-pytz==2023.4.0.20240130
types-PyYAML==6.0.12.12
types-requests==2.31.0.6
types-requests==2.31.0.20240125
types-simplejson==3.19.0.2
types-six==1.16.21.20240106
types-SQLAlchemy==1.4.53.34
types-tabulate==0.9.0.20240106
types-toml==0.10.8.7
types-tzlocal==5.1.0.1
types-urllib3==1.26.25.14
typing-inspect==0.9.0
typing_extensions==4.5.0
tzdata==2023.4
Expand All @@ -566,7 +565,7 @@ unicodecsv==0.14.1
universal-pathlib==0.1.4
uri-template==1.3.0
uritemplate==4.1.1
urllib3==1.26.18
urllib3==2.0.7
uvicorn==0.27.0.post1
uvloop==0.19.0
vine==5.1.0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -335,9 +335,7 @@ def from_dagster_event_record(event_record: EventLogEntry, pipeline_name: str) -
return GrapheneHandledOutputEvent(
output_name=data.output_name,
manager_key=data.manager_key,
metadataEntries=_to_metadata_entries(
dagster_event.event_specific_data.metadata # type: ignore
),
metadataEntries=_to_metadata_entries(dagster_event.event_specific_data.metadata),
**basic_params,
)
elif dagster_event.event_type == DagsterEventType.LOADED_INPUT:
Expand Down
Loading

0 comments on commit a247a1a

Please sign in to comment.