[Enhancement] Upgrade dbt-core to 1.6.0 & support py3.11 Part 3 (#29005)

Fixes #issue

Signed-off-by: Astralidea <astralidea@163.com>
This commit is contained in:
Felix Li 2023-08-10 19:37:48 +08:00 committed by GitHub
parent 00bbf9961f
commit 86403abba9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 9 additions and 10 deletions

View File

@ -13,4 +13,4 @@
# See the License for the specific language governing permissions and
# limitations under the License.
version = "1.1.1"
version = "1.2.0"

View File

@ -74,7 +74,7 @@ class StarRocksAdapter(SQLAdapter):
return exists
def get_relation(self, database: Optional[str], schema: str, identifier: str):
if not self.Relation.include_policy.database:
if not self.Relation.get_default_include_policy().database:
database = None
return super().get_relation(database, schema, identifier)

View File

@ -18,14 +18,12 @@ from dataclasses import dataclass, field
from dbt.adapters.base.relation import BaseRelation, Policy
from dbt.exceptions import DbtRuntimeError
@dataclass
class StarRocksQuotePolicy(Policy):
database: bool = False
schema: bool = True
identifier: bool = True
@dataclass
class StarRocksIncludePolicy(Policy):
database: bool = False
@ -35,8 +33,8 @@ class StarRocksIncludePolicy(Policy):
@dataclass(frozen=True, eq=False, repr=False)
class StarRocksRelation(BaseRelation):
include_policy: StarRocksIncludePolicy = field(default_factory=lambda: StarRocksIncludePolicy())
quote_policy: StarRocksQuotePolicy = field(default_factory=lambda: StarRocksQuotePolicy())
include_policy: StarRocksIncludePolicy = StarRocksIncludePolicy()
quote_character: str = "`"
def __post_init__(self):

View File

@ -16,9 +16,9 @@
import os
import sys
if sys.version_info < (3, 7) or sys.version_info >= (3, 11):
if sys.version_info < (3, 7) or sys.version_info >= (3, 12):
print("Error: dbt-starrocks does not support this version of Python.")
print("Please install Python 3.7 or higher but less than 3.11.")
print("Please install Python 3.7 or higher but less than 3.12.")
sys.exit(1)
from setuptools import find_namespace_packages, setup
@ -41,7 +41,7 @@ with open(os.path.join(this_directory, "README.md")) as f:
package_name = "dbt-starrocks"
# make sure this always matches dbt/adapters/starrocks/__version__.py
package_version = "1.1.1"
package_version = "1.2.0"
description = """The Starrocks adapter plugin for dbt"""
@ -57,7 +57,7 @@ setup(
packages=find_namespace_packages(include=['dbt', 'dbt.*']),
include_package_data=True,
install_requires=[
"dbt-core==1.5.2",
"dbt-core==1.6.0",
"mysql-connector-python>=8.1",
],
zip_safe=False,
@ -74,6 +74,7 @@ setup(
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.9',
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
],
python_requires=">=3.7,<3.11",
python_requires=">=3.7,<3.12",
)