getyourguide / TypedPyspark

Type-annotate your spark dataframes and validate them
Apache License 2.0
14 stars 2 forks source link

mypy fails on readme example #8

Open mooreniemi opened 1 year ago

mooreniemi commented 1 year ago

I'm new to using mypy and Python types. Am I missing a step?

88665a4a7a7f:~ amooren$ mypy /tmp/pst.py
/tmp/pst.py:1: error: Skipping analyzing "typed_pyspark": module is installed, but missing library stubs or py.typed marker  [import]
/tmp/pst.py:1: note: See https://mypy.readthedocs.io/en/stable/running_mypy.html#missing-imports
/tmp/pst.py:21: error: Name "ReviewTable" is not defined  [name-defined]
/tmp/pst.py:38: error: Variable "pst.ReviewTableType" is not valid as a type  [valid-type]
/tmp/pst.py:38: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
/tmp/pst.py:39: error: Variable "pst.Daily_ReviewsType" is not valid as a type  [valid-type]
/tmp/pst.py:39: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
Found 4 errors in 1 file (checked 1 source file)

To make the Readme example runnable I slightly modified it to make the function just call pass.

mooreniemi commented 1 year ago

I don't see any py.typed in https://github.com/getyourguide/TypedPyspark/blob/d9ad544c07ff4a80b2d0349ed8d5a3b7b9fca0ea/setup.py#L18

mooreniemi commented 1 year ago

I think at minimum you will need: https://github.com/mooreniemi/TypedPyspark/pull/1/files