Skip to content

Commit

Permalink
Allow nan values in level columns
Browse files Browse the repository at this point in the history
Related to #944
  • Loading branch information
MariusWirtz committed Sep 25, 2023
1 parent 537e661 commit ec66366
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion TM1py/Services/HierarchyService.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,8 @@ def _validate_edges(df: 'pd.DataFrame'):
for parent in record[1:]:
if not parent:
continue

if isinstance(parent, float) and math.isnan(parent):
continue
graph.add_edge(child, parent)
child = parent

Expand Down
2 changes: 1 addition & 1 deletion Tests/CellService_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -2805,7 +2805,7 @@ def test_execute_mdx_dataframe_use_blob_na_element_name(self):

df = self.tm1.cubes.cells.execute_mdx_dataframe(query, use_blob=True)
self.assertEqual(
[["Element 1","NA", 4.0]],
[["Element 1", "NA", 4.0]],
df.values.tolist())

@skip_if_no_pandas
Expand Down

0 comments on commit ec66366

Please sign in to comment.