Skip to content

[BUG]: py.typed missing #1114

@sbachstein

Description

@sbachstein

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

The py.typed marker to indicate typed Python code is missing from the package, which results, for example, in type checking errors with tools like mypy.

Expected Behavior

Since the package seems to be typed, I would expect the py.typed marker file to be included in the package.

Steps To Reproduce

  1. Run the latest version of mypy on a Python file importing the Databricks DQX package:
import pyspark.sql.functions as F

from databricks.labs.dqx.check_funcs import make_condition
from databricks.labs.dqx.rule import register_rule
from pyspark.sql import Column


@register_rule("row")
def is_not_null(column: str) -> Column:
    return make_condition(
        F.col(column).isNull(),
        f"Column '{column}' is null",
        f"is_not_null_{column}",
    )
  1. See the MyPy error:
dqx_mypy.py:10: error: Returning Any from function declared to return "Column"  [no-any-return]
        return make_condition(
        ^~~~~~~~~~~~~~~~~~~~~~
Found 1 error in 1 file (checked 1 source file)

Cloud

AWS

Operating System

Linux

Relevant log output, error message and full stacktrace

Metadata

Metadata

Assignees

Labels

bugSomething isn't workinggood first issueGood for newcomers or if you are looking at a small ticket

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions