dbt-conveyor-snowflake 1.7.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2024 Data Minded
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1 @@
1
+ recursive-include dbt/include *.sql *.yml *.md
@@ -0,0 +1,20 @@
1
+ Metadata-Version: 2.1
2
+ Name: dbt-conveyor-snowflake
3
+ Version: 1.7.0
4
+ Summary: The ConveyorSnowflake adapter plugin for dbt
5
+ Home-page: https://github.com/datamindedbe/dbt-conveyor-snowflake
6
+ Author: Stijn De Haes
7
+ Author-email: stijn.dehaes@dataminded.be
8
+ Classifier: Development Status :: 3 - Alpha
9
+ Classifier: Operating System :: OS Independent
10
+ Classifier: Programming Language :: Python
11
+ License-File: LICENSE
12
+ Requires-Dist: dbt-core~=1.7.0
13
+ Requires-Dist: dbt-snowflake~=1.7.0
14
+
15
+ The ConveyorSnowflake adapter plugin for dbt
16
+
17
+ This adapter for DBT allows you to authenticate to Snowflake inside of a Conveyor IDE.
18
+ For more information on how to use this plugin check out our how-to-guide:
19
+
20
+ https://docs.conveyordata.com/how-to-guides/conveyor-ides/dbt-snowflake
@@ -0,0 +1,8 @@
1
+ # ConveyorSnowflake
2
+
3
+ The dbt-conveyorsnowflake adapter plugin is a small extension on top of the dbt-snowflake adapter plugin for DBT.
4
+
5
+ It handles authentication from dbt to Snowflake when using it on Conveyor IDE's.
6
+
7
+ For more information on how to use it, check out our
8
+ [how-to-guide](https://docs.conveyordata.com/how-to-guides/conveyor-ides/dbt-snowflake) in the Conveyor docs.
@@ -0,0 +1,23 @@
1
+ from dbt.adapters.snowflake import SnowflakeConnectionManager
2
+
3
+ from dbt.adapters.conveyorsnowflake.connections import ConveyorSnowflakeAdapterCredentials
4
+ from dbt.adapters.snowflake.impl import SnowflakeAdapter
5
+
6
+ from dbt.adapters.base import AdapterPlugin
7
+ from dbt.include import conveyorsnowflake
8
+
9
+
10
+ class ConveyorSnowflakeConnectionManager(SnowflakeConnectionManager):
11
+ TYPE = "conveyorsnowflake"
12
+
13
+
14
+ class ConveyorSnowflakeAdapter(SnowflakeAdapter):
15
+ ConnectionManager = ConveyorSnowflakeConnectionManager
16
+
17
+
18
+ Plugin = AdapterPlugin(
19
+ adapter=ConveyorSnowflakeAdapter,
20
+ credentials=ConveyorSnowflakeAdapterCredentials,
21
+ include_path=conveyorsnowflake.PACKAGE_PATH,
22
+ dependencies=["snowflake"]
23
+ )
@@ -0,0 +1,29 @@
1
+ from dataclasses import dataclass, field
2
+ import dbt.exceptions # noqa
3
+ import subprocess
4
+ from dbt.adapters.snowflake import SnowflakeCredentials
5
+ import json
6
+
7
+ @dataclass
8
+ class ConveyorSnowflakeAdapterCredentials(SnowflakeCredentials):
9
+ # We need to set the default to empty string, otherwise dbt run will complain user is not set and fail
10
+ user: str = field(default='')
11
+ def __post_init__(self):
12
+ token_output = subprocess.run(
13
+ [
14
+ "conveyor", "ide", "snowflake-token",
15
+ f"--snowflake-client-id={self.oauth_client_id}",
16
+ f"--snowflake-client-secret={self.oauth_client_secret}",
17
+ f"--snowflake-account={self.account}",
18
+ "--quiet",
19
+ ],
20
+ stdout=subprocess.PIPE,
21
+ stderr=subprocess.STDOUT,
22
+ )
23
+ self.token = json.loads(token_output.stdout.rstrip().decode())["refresh_token"]
24
+ self.user = json.loads(token_output.stdout.rstrip().decode())["username"]
25
+ super().__post_init__()
26
+
27
+ @property
28
+ def type(self):
29
+ return "conveyorsnowflake"
@@ -0,0 +1,3 @@
1
+ import os
2
+
3
+ PACKAGE_PATH = os.path.dirname(__file__)
@@ -0,0 +1,5 @@
1
+ config-version: 2
2
+ name: dbt_conveyorsnowflake
3
+ version: 1.0
4
+
5
+ macro-paths: []
@@ -0,0 +1,20 @@
1
+ Metadata-Version: 2.1
2
+ Name: dbt-conveyor-snowflake
3
+ Version: 1.7.0
4
+ Summary: The ConveyorSnowflake adapter plugin for dbt
5
+ Home-page: https://github.com/datamindedbe/dbt-conveyor-snowflake
6
+ Author: Stijn De Haes
7
+ Author-email: stijn.dehaes@dataminded.be
8
+ Classifier: Development Status :: 3 - Alpha
9
+ Classifier: Operating System :: OS Independent
10
+ Classifier: Programming Language :: Python
11
+ License-File: LICENSE
12
+ Requires-Dist: dbt-core~=1.7.0
13
+ Requires-Dist: dbt-snowflake~=1.7.0
14
+
15
+ The ConveyorSnowflake adapter plugin for dbt
16
+
17
+ This adapter for DBT allows you to authenticate to Snowflake inside of a Conveyor IDE.
18
+ For more information on how to use this plugin check out our how-to-guide:
19
+
20
+ https://docs.conveyordata.com/how-to-guides/conveyor-ides/dbt-snowflake
@@ -0,0 +1,14 @@
1
+ LICENSE
2
+ MANIFEST.in
3
+ README.md
4
+ setup.py
5
+ dbt/adapters/conveyorsnowflake/__init__.py
6
+ dbt/adapters/conveyorsnowflake/__version__.py
7
+ dbt/adapters/conveyorsnowflake/connections.py
8
+ dbt/include/conveyorsnowflake/__init__.py
9
+ dbt/include/conveyorsnowflake/dbt_project.yml
10
+ dbt_conveyor_snowflake.egg-info/PKG-INFO
11
+ dbt_conveyor_snowflake.egg-info/SOURCES.txt
12
+ dbt_conveyor_snowflake.egg-info/dependency_links.txt
13
+ dbt_conveyor_snowflake.egg-info/requires.txt
14
+ dbt_conveyor_snowflake.egg-info/top_level.txt
@@ -0,0 +1,2 @@
1
+ dbt-core~=1.7.0
2
+ dbt-snowflake~=1.7.0
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
@@ -0,0 +1,36 @@
1
+ #!/usr/bin/env python
2
+ from setuptools import find_namespace_packages, setup
3
+
4
+ package_name = "dbt-conveyor-snowflake"
5
+ # make sure this always matches dbt/adapters/{adapter}/__version__.py
6
+ description = """The ConveyorSnowflake adapter plugin for dbt
7
+
8
+ This adapter for DBT allows you to authenticate to Snowflake inside of a Conveyor IDE.
9
+ For more information on how to use this plugin check out our how-to-guide:
10
+
11
+ https://docs.conveyordata.com/how-to-guides/conveyor-ides/dbt-snowflake
12
+ """
13
+
14
+ setup(
15
+ name=package_name,
16
+ description=description,
17
+ setuptools_git_versioning={
18
+ "enabled": True,
19
+ },
20
+ long_description=description,
21
+ author="Stijn De Haes",
22
+ author_email="stijn.dehaes@dataminded.be",
23
+ url="https://github.com/datamindedbe/dbt-conveyor-snowflake",
24
+ classifiers=[
25
+ "Development Status :: 3 - Alpha",
26
+ "Operating System :: OS Independent",
27
+ "Programming Language :: Python",
28
+ ],
29
+ packages=find_namespace_packages(include=["dbt", "dbt.*"]),
30
+ include_package_data=True,
31
+ install_requires=[
32
+ "dbt-core~=1.7.0",
33
+ "dbt-snowflake~=1.7.0",
34
+ ],
35
+ setup_requires=["setuptools-git-versioning<2"],
36
+ )