Skip to content

Commit 84d3991

Browse files
authored
Merge pull request #100 from peak-solution/dev
build: Release 1.0.4
2 parents ac5da62 + 94958c7 commit 84d3991

14 files changed

+103
-17
lines changed

.devcontainer/Dockerfile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ ENV FLIT_ROOT_INSTALL=1
77

88
COPY pyproject.toml .
99
RUN touch README.md \
10+
touch LICENSE \
1011
&& mkdir -p src/odsbox \
1112
&& python -m flit install --only-deps --deps develop \
12-
&& rm -r pyproject.toml README.md src
13+
&& rm -r pyproject.toml README.md LICENSE src

.github/workflows/sphinx.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,4 @@ jobs:
1515
id-token: write
1616
steps:
1717
- id: deployment
18-
uses: sphinx-notes/pages@3.1
18+
uses: sphinx-notes/pages@3.2

pyproject.toml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -31,29 +31,29 @@ classifiers = [
3131
requires-python = ">=3.10.12"
3232
dynamic = ["version"]
3333
dependencies = [
34-
"protobuf>=5.27.0,<6.0.0",
34+
"protobuf>=5.27.0,<7.0.0",
3535
"requests>=2.30.0,<3.0.0",
3636
"pandas>=2.2.0,<3.0.0",
3737
]
3838

3939
[project.optional-dependencies]
4040
exd-data = ["grpcio>=1.59.3,<2.0.0"]
4141
test = [
42-
"bandit[toml]==1.7.10",
43-
"black==24.10.0",
42+
"bandit[toml]==1.8.3",
43+
"black==25.1.0",
4444
"check-manifest==0.50",
45-
"flake8-bugbear==24.8.19",
45+
"flake8-bugbear==24.12.12",
4646
"flake8-docstrings",
4747
"flake8-formatter_junit_xml",
4848
"flake8",
4949
"flake8-pyproject",
50-
"pre-commit==4.0.1",
51-
"pylint==3.3.1",
50+
"pre-commit==4.2.0",
51+
"pylint==3.3.4",
5252
"pylint_junit",
5353
"pytest-cov==6.0.0",
5454
"pytest-mock<3.14.1",
5555
"pytest-runner",
56-
"pytest==8.3.3",
56+
"pytest==8.3.5",
5757
"pytest-github-actions-annotate-failures",
5858
"pytest-xdist",
5959
"shellcheck-py==0.10.0.1",

src/odsbox/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22

33
from __future__ import annotations
44

5-
__version__ = "1.0.3"
5+
__version__ = "1.0.4"

src/odsbox/con_i.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ def __call__(self, r):
136136
self.model_read()
137137

138138
def __del__(self):
139-
if None is not self.__session:
139+
if self.__session is not None:
140140
self.logout()
141141

142142
def __enter__(self):

src/odsbox/jaquel.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,12 @@ def __parse_path_and_add_joins(
250250
attribute_name = relation.name
251251

252252
# add join
253-
if (-1 == relation.range_max) and (1 == relation.inverse_range_max):
253+
if (
254+
(-1 == relation.range_max)
255+
and (1 == relation.inverse_range_max)
256+
and join_type != ods.SelectStatement.JoinItem.JoinTypeEnum.JT_OUTER
257+
):
258+
# in case of OUTER join the direction is important and must be like addressed
254259
inverse_entity = model.entities[relation.entity_name]
255260
inverse_relation = inverse_entity.relations[relation.inverse_name]
256261
__add_join_to_seq(model, inverse_entity, inverse_relation, joins, join_type)

src/odsbox/submatrix_to_pandas.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ def __convert_bulk_to_pandas_data_frame(
8080
]
8181

8282
rv = pd.DataFrame(column_dict)
83-
if None is not independent_local_column_name:
83+
if independent_local_column_name is not None:
8484
rv.set_index(independent_local_column_name)
8585

8686
return rv

tests/test_con_i.py

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
def __create_con_i():
1212
"""Create a connection session for an ASAM ODS server"""
13-
return ConI("http://79.140.180.128:10032/api", ("sa", "sa"))
13+
return ConI("https://docker.peak-solution.de:10032/api", ("Demo", "mdm"))
1414

1515

1616
def test_con_i():
@@ -82,3 +82,24 @@ def test_submatrix_load():
8282
logging.getLogger().info(submatrix_id)
8383
submatrix_dataframe = submatrix_to_pandas(con_i, submatrix_id)
8484
assert submatrix_dataframe is not None
85+
86+
87+
def test_bug_93_outer_join_on_n_relation():
88+
logging.getLogger().info(
89+
"In case of outer join the direction is important and must point from n to 1 when generated from jaquel."
90+
)
91+
with __create_con_i() as con_i:
92+
df = con_i.query_data(
93+
{
94+
"AoMeasurement": {},
95+
"$attributes": {
96+
"name": 1,
97+
"measurement_quantities:OUTER": {"name": 1, "unit:OUTER.name": 1},
98+
"submatrices:OUTER.name": 1,
99+
},
100+
"$options": {"$rowlimit": 10},
101+
}
102+
)
103+
assert df is not None
104+
assert df.empty is False
105+
assert 4 == len(df.columns)

tests/test_con_i_file_access.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
@pytest.fixture
1414
def con_i():
15-
return ConI("http://79.140.180.128:10032/api", ("sa", "sa"))
15+
return ConI("https://docker.peak-solution.de:10032/api", ("Demo", "mdm"))
1616

1717

1818
def test_file_access_download_success(con_i):
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"AoMeasurement": {},
3+
"$attributes": {
4+
"name": 1,
5+
"measurement_quantities:OUTER": {
6+
"name": 1,
7+
"unit:OUTER.name": 1
8+
},
9+
"submatrices:OUTER.name": 1
10+
},
11+
"$options": {
12+
"$rowlimit": 10
13+
}
14+
}

0 commit comments

Comments
 (0)