-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* #171: Updated poetry dependencies * Copied subdirectories from data-science-utils-python into subdirectory exasol_data_science_utils_python. * Added tests from data-science-utils-python * Updated ITDE from 1.7.0 to 3.1.0 * Use default port forward for Exasol database * GitHub workflow files: Updated python version from 3.8 to 3.10 * Updated base flavor SLC to Exasol-all-python-3.10 * Updated from python 3,8 to python 3.10 except for vagrant provisioning * Changed bucketfs real_port to 2580,
- Loading branch information
Showing
91 changed files
with
3,816 additions
and
1,552 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -155,3 +155,6 @@ doc/_build | |
# vagrant | ||
|
||
.vagrant | ||
|
||
# emacs | ||
TAGS |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,4 +5,4 @@ channels: | |
dependencies: | ||
- lua==5.4.* | ||
- luarocks | ||
- python==3.8.* | ||
- python==3.10.* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import dataclasses | ||
|
||
import typeguard | ||
|
||
from exasol_data_science_utils_python.schema.column_name import ColumnName | ||
from exasol_data_science_utils_python.schema.column_type import ColumnType | ||
from exasol_data_science_utils_python.utils.data_classes_runtime_type_check import check_dataclass_types | ||
|
||
|
||
@dataclasses.dataclass(frozen=True, repr=True, eq=True) | ||
class Column: | ||
name: ColumnName | ||
type: ColumnType | ||
|
||
def __post_init__(self): | ||
check_dataclass_types(self) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
from typing import Union | ||
|
||
from exasol_data_science_utils_python.schema.column import Column | ||
from exasol_data_science_utils_python.schema.column_name import ColumnName | ||
from exasol_data_science_utils_python.schema.column_type import ColumnType | ||
|
||
|
||
class ColumnBuilder: | ||
def __init__(self, column: Union[Column, None] = None): | ||
if column is not None: | ||
self._name = column.name | ||
self._type = column.type | ||
else: | ||
self._name = None | ||
self._type = None | ||
|
||
def with_name(self, name: ColumnName) -> "ColumnBuilder": | ||
self._name = name | ||
return self | ||
|
||
def with_type(self, type: ColumnType) -> "ColumnBuilder": | ||
self._type = type | ||
return self | ||
|
||
def build(self) -> Column: | ||
column = Column(self._name, self._type) | ||
return column |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
from typeguard import typechecked | ||
|
||
from exasol_data_science_utils_python.schema.exasol_identifier import ExasolIdentifier | ||
from exasol_data_science_utils_python.schema.exasol_identifier_impl import ExasolIdentifierImpl | ||
from exasol_data_science_utils_python.schema.table_name import TableLikeName | ||
from exasol_data_science_utils_python.utils.hash_generation_for_object import generate_hash_for_object | ||
from exasol_data_science_utils_python.utils.repr_generation_for_object import generate_repr_for_object | ||
|
||
|
||
class ColumnName(ExasolIdentifierImpl): | ||
@typechecked | ||
def __init__(self, name: str, table_like_name: TableLikeName = None): | ||
super().__init__(name) | ||
self._table_like_name = table_like_name | ||
|
||
@property | ||
def table_like_name(self): | ||
return self._table_like_name | ||
|
||
@property | ||
def fully_qualified(self) -> str: | ||
if self.table_like_name is not None: | ||
return f'{self._table_like_name.fully_qualified}.{self.quoted_name}' | ||
else: | ||
return self.quoted_name | ||
|
||
def __eq__(self, other): | ||
return isinstance(other, ColumnName) and \ | ||
self._name == other.name and \ | ||
self._table_like_name == other.table_like_name | ||
|
||
def __repr__(self): | ||
return generate_repr_for_object(self) | ||
|
||
def __hash__(self): | ||
return generate_hash_for_object(self) |
41 changes: 41 additions & 0 deletions
41
exasol_data_science_utils_python/schema/column_name_builder.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
from typing import Optional | ||
|
||
from exasol_data_science_utils_python.schema.column_name import ColumnName | ||
from exasol_data_science_utils_python.schema.table_name import TableLikeName | ||
|
||
|
||
class ColumnNameBuilder: | ||
def __init__(self, | ||
name: Optional[str] = None, | ||
table_like_name: Optional[TableLikeName] = None, | ||
column_name: Optional[ColumnName] = None): | ||
""" | ||
Creates a builder for ColumnName objects, | ||
either by copying a ColumnName object or | ||
using the newly provided values. | ||
""" | ||
self._name = None | ||
self._table_like_name = None | ||
if column_name is not None: | ||
self._name = column_name.name | ||
self._table_like_name = column_name.table_like_name | ||
if name is not None: | ||
self._name = name | ||
if table_like_name is not None: | ||
self._table_like_name = table_like_name | ||
|
||
def with_name(self, name: str) -> "ColumnNameBuilder": | ||
self._name = name | ||
return self | ||
|
||
def with_table_like_name(self, table_like_name: TableLikeName) -> "ColumnNameBuilder": | ||
self._table_like_name = table_like_name | ||
return self | ||
|
||
def build(self) -> ColumnName: | ||
name = self.create(self._name, table_like_name=self._table_like_name) | ||
return name | ||
|
||
@staticmethod | ||
def create(name: str, table_like_name: Optional[TableLikeName] = None) -> ColumnName: | ||
return ColumnName(name, table_like_name) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import dataclasses | ||
from typing import Optional | ||
|
||
import typeguard | ||
|
||
from exasol_data_science_utils_python.utils.data_classes_runtime_type_check import check_dataclass_types | ||
|
||
|
||
@dataclasses.dataclass(frozen=True, repr=True, eq=True) | ||
class ColumnType: | ||
name: str | ||
precision: Optional[int] = None | ||
scale: Optional[int] = None | ||
size: Optional[int] = None | ||
characterSet: Optional[str] = None | ||
withLocalTimeZone: Optional[bool] = None | ||
fraction: Optional[int] = None | ||
srid: Optional[int] = None | ||
|
||
def __post_init__(self): | ||
check_dataclass_types(self) |
14 changes: 14 additions & 0 deletions
14
exasol_data_science_utils_python/schema/connection_object_name.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
from abc import abstractmethod | ||
|
||
from exasol_data_science_utils_python.schema.dbobject_name import DBObjectName | ||
|
||
|
||
class ConnectionObjectName(DBObjectName): | ||
|
||
@property | ||
@abstractmethod | ||
def normalized_name_for_udfs(self) -> str: | ||
""" | ||
The normalized name of the ConnectionObject | ||
which can be used in UDFs to retrieve the ConnectionObject | ||
""" |
22 changes: 22 additions & 0 deletions
22
exasol_data_science_utils_python/schema/connection_object_name_builder.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
from typing import Union, Optional | ||
|
||
from exasol_data_science_utils_python.schema.connection_object_name import ConnectionObjectName | ||
from exasol_data_science_utils_python.schema.connection_object_name_impl import ConnectionObjectNameImpl | ||
from exasol_data_science_utils_python.schema.schema_name import SchemaName | ||
from exasol_data_science_utils_python.schema.table_name import TableName | ||
from exasol_data_science_utils_python.schema.table_name_impl import TableNameImpl | ||
from exasol_data_science_utils_python.schema.view_name import ViewName | ||
from exasol_data_science_utils_python.schema.view_name_impl import ViewNameImpl | ||
|
||
|
||
class ConnectionObjectNameBuilder: | ||
|
||
def __init__(self, name: str): | ||
self._name = name | ||
|
||
def build(self) -> ConnectionObjectName: | ||
return self.create(self._name) | ||
|
||
@classmethod | ||
def create(cls, name: str): | ||
return ConnectionObjectNameImpl(name) |
Oops, something went wrong.