Skip to content
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

Bump python sdk version #827

Open
wants to merge 42 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
6a17257
Add support for Serverless jobs / refactor api usage (#706)
benc-db Jun 24, 2024
3cf4aba
Merge branch 'main' into 1.9.latest
benc-db Jun 25, 2024
4795063
Cleanup test warnings (#713)
benc-db Jun 25, 2024
bcab2a4
Merge branch 'main' into 1.9.latest
benc-db Jul 1, 2024
855bb5e
Fix dbt seed command error when seed file is partially defined in the…
kass-artur Jul 8, 2024
17433f3
Readd external type (#728)
benc-db Jul 9, 2024
8e88384
Upgrade to PySQL 3.2.0 (#729)
benc-db Jul 9, 2024
3577f85
Merge branch 'main' into 1.9.latest
benc-db Jul 26, 2024
708cf60
Merge branch 'main' into 1.9.latest
benc-db Aug 12, 2024
25636de
bump python sdk version
eric-wang-1990 Aug 14, 2024
12c077b
update
eric-wang-1990 Aug 14, 2024
a35918b
Extend Merge Capabilities (#739)
mi-volodin Aug 19, 2024
a2b8ce9
Merge branch 'main' into 1.9.latest
benc-db Aug 20, 2024
b8486d1
Forward porting latest 1.8 changes into 1.9 branch (#788)
benc-db Sep 13, 2024
98177fe
Upgrade PySql to 3.4.0 (#790)
benc-db Sep 13, 2024
092296b
Add custom constraint option (#792)
roydobbe Sep 16, 2024
dcbeb0c
Merge branch 'main' into 1.9.latest
benc-db Sep 19, 2024
60b487d
Merge branch 'main' into 1.9.latest
benc-db Sep 25, 2024
41c164e
Behavior: Get column info from information_schema Part I (#808)
benc-db Sep 27, 2024
3412461
Simple Iceberg support (#815)
benc-db Oct 3, 2024
103f1b1
Merge branch 'main' into 1.9.latest
benc-db Oct 4, 2024
7e6b450
fix merge issue
benc-db Oct 4, 2024
74c7862
Merge branch 'main' into 1.9.latest
benc-db Oct 10, 2024
0e821b0
Draft: #756 - implement python workflow submissions (#762)
kdazzle Oct 10, 2024
00dd9f8
Behavior for external path (#823)
benc-db Oct 11, 2024
5b8d938
Merge branch '1.9.latest' of github.com-ghec:databricks/dbt-databrick…
eric-wang-1990 Oct 14, 2024
d0378d2
Implement microbatch incremental strategy (#825)
benc-db Oct 15, 2024
bf6be45
Merge branch 'main' into 1.9.latest
benc-db Oct 16, 2024
cca2e8d
Merge branch 'main' into 1.9.latest
benc-db Oct 23, 2024
a944656
up to b2
benc-db Oct 23, 2024
823f5f2
beta 2
benc-db Oct 25, 2024
047cec7
Merge branch 'prep_1.9.0b2' into 1.9.latest
benc-db Oct 25, 2024
ccaa2f8
Release candidate
benc-db Oct 29, 2024
403e496
update
eric-wang-1990 Oct 31, 2024
5a8f9c0
Merge branch '1.9.latest' of github.com-ghec:databricks/dbt-databrick…
eric-wang-1990 Oct 31, 2024
41092ba
update
eric-wang-1990 Oct 31, 2024
737f021
fix token test
eric-wang-1990 Oct 31, 2024
8c8417c
test
eric-wang-1990 Nov 14, 2024
c4aa1a3
fix test, add lock
eric-wang-1990 Nov 15, 2024
8dcba15
update
eric-wang-1990 Nov 16, 2024
bfe05a9
Merge branch 'main' of github.com-ghec:databricks/dbt-databricks into…
eric-wang-1990 Nov 16, 2024
55de168
update
eric-wang-1990 Nov 16, 2024
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
2 changes: 1 addition & 1 deletion dbt/adapters/databricks/__version__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
version: str = "1.9.0b1"
version: str = "1.9.0rc1"
5 changes: 2 additions & 3 deletions dbt/adapters/databricks/api_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

from dbt.adapters.databricks import utils
from dbt.adapters.databricks.__version__ import version
from dbt.adapters.databricks.auth import BearerAuth
from dbt.adapters.databricks.credentials import BearerAuth
from dbt.adapters.databricks.credentials import DatabricksCredentials
from dbt.adapters.databricks.logging import logger
from dbt_common.exceptions import DbtRuntimeError
Expand Down Expand Up @@ -499,8 +499,7 @@ def create(
http_headers = credentials.get_all_http_headers(
connection_parameters.pop("http_headers", {})
)
credentials_provider = credentials.authenticate(None)
header_factory = credentials_provider(None) # type: ignore
header_factory = credentials.authenticate().credentials_provider # type: ignore
session.auth = BearerAuth(header_factory)

session.headers.update({"User-Agent": user_agent, **http_headers})
Expand Down
105 changes: 0 additions & 105 deletions dbt/adapters/databricks/auth.py

This file was deleted.

16 changes: 9 additions & 7 deletions dbt/adapters/databricks/connections.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@
from dbt.adapters.contracts.connection import LazyHandle
from dbt.adapters.databricks.__version__ import version as __version__
from dbt.adapters.databricks.api_client import DatabricksApiClient
from dbt.adapters.databricks.auth import BearerAuth
from dbt.adapters.databricks.credentials import BearerAuth
from dbt.adapters.databricks.credentials import DatabricksCredentialManager
from dbt.adapters.databricks.credentials import DatabricksCredentials
from dbt.adapters.databricks.credentials import TCredentialProvider
from dbt.adapters.databricks.events.connection_events import ConnectionAcquire
from dbt.adapters.databricks.events.connection_events import ConnectionCancel
from dbt.adapters.databricks.events.connection_events import ConnectionCancelError
Expand Down Expand Up @@ -471,7 +471,7 @@ def _reset_handle(self, open: Callable[[Connection], Connection]) -> None:

class DatabricksConnectionManager(SparkConnectionManager):
TYPE: str = "databricks"
credentials_provider: Optional[TCredentialProvider] = None
credentials_manager: Optional[DatabricksCredentialManager] = None
_user_agent = f"dbt-databricks/{__version__}"

def cancel_open(self) -> list[str]:
Expand Down Expand Up @@ -721,7 +721,7 @@ def _open(cls, connection: Connection, query_header_context: Any = None) -> Conn
timeout = creds.connect_timeout

# gotta keep this so we don't prompt users many times
cls.credentials_provider = creds.authenticate(cls.credentials_provider)
cls.credentials_manager = creds.authenticate()

invocation_env = creds.get_invocation_env()
user_agent_entry = cls._user_agent
Expand All @@ -739,12 +739,13 @@ def _open(cls, connection: Connection, query_header_context: Any = None) -> Conn
http_path = _get_http_path(query_header_context, creds)

def connect() -> DatabricksSQLConnectionWrapper:
assert cls.credentials_manager is not None
try:
# TODO: what is the error when a user specifies a catalog they don't have access to
conn: DatabricksSQLConnection = dbsql.connect(
server_hostname=creds.host,
http_path=http_path,
credentials_provider=cls.credentials_provider,
credentials_provider=cls.credentials_manager.credentials_provider,
http_headers=http_headers if http_headers else None,
session_configuration=creds.session_properties,
catalog=creds.database,
Expand Down Expand Up @@ -1013,7 +1014,7 @@ def open(cls, connection: Connection) -> Connection:
timeout = creds.connect_timeout

# gotta keep this so we don't prompt users many times
cls.credentials_provider = creds.authenticate(cls.credentials_provider)
cls.credentials_manager = creds.authenticate()

invocation_env = creds.get_invocation_env()
user_agent_entry = cls._user_agent
Expand All @@ -1031,12 +1032,13 @@ def open(cls, connection: Connection) -> Connection:
http_path = databricks_connection.http_path

def connect() -> DatabricksSQLConnectionWrapper:
assert cls.credentials_manager is not None
try:
# TODO: what is the error when a user specifies a catalog they don't have access to
conn = dbsql.connect(
server_hostname=creds.host,
http_path=http_path,
credentials_provider=cls.credentials_provider,
credentials_provider=cls.credentials_manager.credentials_provider,
http_headers=http_headers if http_headers else None,
session_configuration=creds.session_properties,
catalog=creds.database,
Expand Down
Loading
Loading