Skip to content

Commit

Permalink
#171: Updated poetry dependencies (#172)
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
ckunki authored Jul 2, 2024
1 parent dea65c5 commit 2b59f9b
Show file tree
Hide file tree
Showing 91 changed files with 3,816 additions and 1,552 deletions.
2 changes: 1 addition & 1 deletion .github/actions/prepare_poetry_env/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ inputs:
python-version:
description: 'The Python version to use'
required: true
default: '3.8'
default: '3.10'
runs:
using: "composite"
steps:
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/check_packaging.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: [3.8]
python-version: [ "3.10" ]
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- name: Setup Python & Poetry Environment
uses: ./.github/actions/prepare_poetry_env
Expand All @@ -36,4 +36,4 @@ jobs:

- name: Check if packaging changed
run: |
[ -z "$(git status --porcelain=v1 -uno 2>/dev/null)" ]
[ -z "$(git status --porcelain=v1 -uno 2>/dev/null)" ]
4 changes: 2 additions & 2 deletions .github/workflows/integration_tests_with_db.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: [ 3.8 ]
python-version: [ "3.10" ]
runs-on: ubuntu-latest

steps:
Expand All @@ -23,7 +23,7 @@ jobs:
docker-images: true
swap-storage: false

- uses: actions/checkout@v2
- uses: actions/checkout@v4

- name: Setup Python & Poetry Environment
uses: ./.github/actions/prepare_poetry_env
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/integration_tests_without_db.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: [ 3.8 ]
python-version: [ "3.10" ]
runs-on: ubuntu-latest
name: Prepare Matrix for integration tests without DB
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- name: Setup Python & Poetry Environment
uses: ./.github/actions/prepare_poetry_env
Expand All @@ -28,12 +28,12 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: [ 3.8 ]
python-version: [ "3.10" ]
test-path: ${{ fromJSON(needs.prepare_matrix.outputs.test-path) }}
runs-on: ubuntu-latest
name: Run ${{ matrix.test-path.name }}
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- name: Setup Python & Poetry Environment
uses: ./.github/actions/prepare_poetry_env
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
steps:

- name: SCM Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Setup Python & Poetry Environment
uses: ./.github/actions/prepare_poetry_env
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/unit_tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: [3.8]
python-version: [ "3.10" ]
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- name: Setup Python & Poetry Environment
uses: ./.github/actions/prepare_poetry_env
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -155,3 +155,6 @@ doc/_build
# vagrant

.vagrant

# emacs
TAGS
2 changes: 1 addition & 1 deletion conda.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ channels:
dependencies:
- lua==5.4.*
- luarocks
- python==3.8.*
- python==3.10.*
61 changes: 31 additions & 30 deletions doc/changes/changes_0.1.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,43 +6,44 @@

### Features

- #1: Added the initial setup of the project
- #4: Added the design document
- #5: Added the system requirements document
- #7: Added Lua event loop
- #6: Added Python event handler
- #24: Added integrations test for event loop
- #28: Extended the EventHandlerContext to a scope-based system for handling temporary objects
- #29: Fixed interface of EventContext and adapted implementation of UDFEventContext
- #30: Sort cleanup queries in reverse order of their creation to ensure that temporary objects that depend on other are removed first
- #34: Added MockEventContext
- #35: Clean up after EventHandler exceptions and throw exceptions when a parent EventHandlerContext encounters an unreleased child during release
- #94: Prepare for release to PyPi
- #17: Added vagrant setup
- #97: Added SocketFactory wrapper which injects faults by losing messages
- #98: Added more robust connection protocol
- #99: Added multi/node udf discovery
- #100: Add combined global and local UDF discovery
* #1: Added the initial setup of the project
* #4: Added the design document
* #5: Added the system requirements document
* #7: Added Lua event loop
* #6: Added Python event handler
* #24: Added integrations test for event loop
* #28: Extended the EventHandlerContext to a scope-based system for handling temporary objects
* #29: Fixed interface of EventContext and adapted implementation of UDFEventContext
* #30: Sort cleanup queries in reverse order of their creation to ensure that temporary objects that depend on other are removed first
* #34: Added MockEventContext
* #35: Clean up after EventHandler exceptions and throw exceptions when a parent EventHandlerContext encounters an unreleased child during release
* #94: Prepare for release to PyPi
* #17: Added vagrant setup
* #97: Added SocketFactory wrapper which injects faults by losing messages
* #98: Added more robust connection protocol
* #99: Added multi/node udf discovery
* #100: Add combined global and local UDF discovery

### Bug Fixes

- #8: Renamed master branch to main
- #62: Fixed bug in ScopeQueryHandlerContext transfer_object_to
- #64: Removed `_check_if_released` calls in `__eq__` and `__hash__` for DBObjectNameProxy
- #65: Fixed that the `ScopeQueryHandlerContext` might not `_release` all child contexts, if a grand-child-context wasn't released
- #68: Fixed that methods called in BucketFSLocationProxy.cleanup can fail and stop the cleanup
- #66: Fixed _ScopeQueryHandlerContextBase.get_temporary_path not being private
- #116: Fix AbortTimeoutSender and add reason to Timeout messages
* #8: Renamed master branch to main
* #62: Fixed bug in ScopeQueryHandlerContext transfer_object_to
* #64: Removed `_check_if_released` calls in `__eq__` and `__hash__` for DBObjectNameProxy
* #65: Fixed that the `ScopeQueryHandlerContext` might not `_release` all child contexts, if a grand-child-context wasn't released
* #68: Fixed that methods called in BucketFSLocationProxy.cleanup can fail and stop the cleanup
* #66: Fixed _ScopeQueryHandlerContextBase.get_temporary_path not being private
* #116: Fix AbortTimeoutSender and add reason to Timeout messages

### Refactoring

- #42: Updated dependencies
- #72: Unified naming of released resources in QueryHandler
- #88: Introduced an abstraction for ZMQ in UDF Communication
- #95: Remove setup.py
- #114: Refactored BackgroundPeerState and introduced parameter objects
* #171: Updated poetry dependencies
* #42: Updated dependencies
* #72: Unified naming of released resources in QueryHandler
* #88: Introduced an abstraction for ZMQ in UDF Communication
* #95: Remove setup.py
* #114: Refactored BackgroundPeerState and introduced parameter objects

### Documentation

- #9: Added README file
* #9: Added README file

2 changes: 1 addition & 1 deletion doc/developer_guide/developer_environment.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ For this project you need

- Lua 5.4
- Luarocks 3.*
- Python 3.8
- Python 3.10
- Poetry

### Install on a desktop machine
Expand Down
Empty file.
16 changes: 16 additions & 0 deletions exasol_data_science_utils_python/schema/column.py
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)
27 changes: 27 additions & 0 deletions exasol_data_science_utils_python/schema/column_builder.py
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
36 changes: 36 additions & 0 deletions exasol_data_science_utils_python/schema/column_name.py
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 exasol_data_science_utils_python/schema/column_name_builder.py
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)
21 changes: 21 additions & 0 deletions exasol_data_science_utils_python/schema/column_type.py
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 exasol_data_science_utils_python/schema/connection_object_name.py
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
"""
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)
Loading

0 comments on commit 2b59f9b

Please sign in to comment.