Skip to content

Fixing a couple type problems: how I would address most of #381 #382

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Apr 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Empty file added src/databricks/py.typed
Empty file.
8 changes: 7 additions & 1 deletion src/databricks/sql/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,12 @@

import re

from typing import TYPE_CHECKING

if TYPE_CHECKING:
# Use this import purely for type annotations, a la https://mypy.readthedocs.io/en/latest/runtime_troubles.html#import-cycles
from .client import Connection


class RedactUrlQueryParamsFilter(logging.Filter):
pattern = re.compile(r"(\?|&)([\w-]+)=([^&]+)")
Expand Down Expand Up @@ -78,7 +84,7 @@ def TimestampFromTicks(ticks):
return Timestamp(*time.localtime(ticks)[:6])


def connect(server_hostname, http_path, access_token=None, **kwargs):
def connect(server_hostname, http_path, access_token=None, **kwargs) -> "Connection":
from .client import Connection

return Connection(server_hostname, http_path, access_token, **kwargs)
Loading