cognite-neat 0.117.2__py3-none-any.whl → 0.117.3__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of cognite-neat might be problematic. Click here for more details.

@@ -1,5 +1,7 @@
1
+ import warnings
1
2
  from dataclasses import dataclass, field
2
3
  from typing import Any, Literal, cast, overload
4
+ from warnings import catch_warnings
3
5
 
4
6
  import pandas as pd
5
7
  from openpyxl import load_workbook
@@ -67,12 +69,22 @@ def read_individual_sheet(
67
69
  expected_headers: list[str] | None = None,
68
70
  ) -> tuple[list[dict], SpreadsheetRead] | list[dict]:
69
71
  if expected_headers:
70
- target_row = _get_row_number(cast(Worksheet, load_workbook(excel_file)[sheet_name]), expected_headers)
72
+ with catch_warnings():
73
+ # When reading spreadsheets produced by neat, they contain dropdowns. These
74
+ # are not supported by openpyxl and will raise a warning as openpyxl cannot validate these.
75
+ # We ignore these warnings as Neat will do the same checks.
76
+ warnings.simplefilter("ignore")
77
+ target_row = _get_row_number(cast(Worksheet, load_workbook(excel_file)[sheet_name]), expected_headers)
71
78
  skiprows = target_row - 1 if target_row is not None else 0
72
79
  else:
73
80
  skiprows = 0
74
81
 
75
- raw = pd.read_excel(excel_file, sheet_name, skiprows=skiprows)
82
+ with catch_warnings():
83
+ # When reading spreadsheets produced by neat, they contain dropdowns. These
84
+ # are not supported by openpyxl and will raise a warning as openpyxl cannot validate these.
85
+ # We ignore these warnings as Neat will do the same checks.
86
+ warnings.simplefilter("ignore")
87
+ raw = pd.read_excel(excel_file, sheet_name, skiprows=skiprows)
76
88
  is_na = raw.isnull().all(axis=1)
77
89
  skip_rows = _find_rows_to_skip(raw)
78
90
  empty_rows = is_na[is_na].index.tolist()
cognite/neat/_version.py CHANGED
@@ -1,2 +1,2 @@
1
- __version__ = "0.117.2"
1
+ __version__ = "0.117.3"
2
2
  __engine__ = "^2.0.4"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: cognite-neat
3
- Version: 0.117.2
3
+ Version: 0.117.3
4
4
  Summary: Knowledge graph transformation
5
5
  License: Apache-2.0
6
6
  Author: Nikola Vasiljevic
@@ -172,15 +172,15 @@ cognite/neat/_utils/io_.py,sha256=D2Mg8sOxfBoDg3fC0jBzaxO3vkXmr0QvZSgYIv6xRkM,38
172
172
  cognite/neat/_utils/rdf_.py,sha256=v4m8DD9dcHkALSx6wStC2h3kj-e3BmhxJT20fydtw7g,9897
173
173
  cognite/neat/_utils/reader/__init__.py,sha256=fPkrNB_9hLB7CyHTCFV_xEbIfOMqUQzNly5JN33-QfM,146
174
174
  cognite/neat/_utils/reader/_base.py,sha256=Q35hz8tqAiQiELjE4DsDDKQHLtRmSTrty4Gep9rg_CU,5444
175
- cognite/neat/_utils/spreadsheet.py,sha256=_QaziVzo83X6vuXdAmqp4HgMmF3eb9PrTRwq8F1POl4,4652
175
+ cognite/neat/_utils/spreadsheet.py,sha256=EQRBnz9ngDmJOSiwURuA8MuGr4SBh--TXAiwHVh3AjA,5370
176
176
  cognite/neat/_utils/text.py,sha256=BFJoEOQBFgpelysL92FdF0OVRVFl0q9tRNoz-oRanNc,7779
177
177
  cognite/neat/_utils/time_.py,sha256=O30LUiDH9TdOYz8_a9pFqTtJdg8vEjC3qHCk8xZblG8,345
178
178
  cognite/neat/_utils/upload.py,sha256=xWtM6mFuD2QYQHaZ7zCAuGptbEpPIxcH-raWQu93-Ug,5845
179
179
  cognite/neat/_utils/xml_.py,sha256=FQkq84u35MUsnKcL6nTMJ9ajtG9D5i1u4VBnhGqP2DQ,1710
180
- cognite/neat/_version.py,sha256=QPLtZ3sS71bmoKNu3TyTYKy7lRyMCDh2l6Ur8ITOlz8,46
180
+ cognite/neat/_version.py,sha256=Mq83M_aJkEBl20VzJNcykJC-jfTe7cW3N0AzKK5qaRU,46
181
181
  cognite/neat/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
182
- cognite_neat-0.117.2.dist-info/LICENSE,sha256=W8VmvFia4WHa3Gqxq1Ygrq85McUNqIGDVgtdvzT-XqA,11351
183
- cognite_neat-0.117.2.dist-info/METADATA,sha256=ekCAFZpHqHGP0JjfiP9NOa7ETMffALadml3HTGnfWvQ,5361
184
- cognite_neat-0.117.2.dist-info/WHEEL,sha256=XbeZDeTWKc1w7CSIyre5aMDU_-PohRwTQceYnisIYYY,88
185
- cognite_neat-0.117.2.dist-info/entry_points.txt,sha256=SsQlnl8SNMSSjE3acBI835JYFtsIinLSbVmHmMEXv6E,51
186
- cognite_neat-0.117.2.dist-info/RECORD,,
182
+ cognite_neat-0.117.3.dist-info/LICENSE,sha256=W8VmvFia4WHa3Gqxq1Ygrq85McUNqIGDVgtdvzT-XqA,11351
183
+ cognite_neat-0.117.3.dist-info/METADATA,sha256=nTzkS7V56_K7yUiPk2I5KAlU6B-qfBiS4FFXmCT4Ezk,5361
184
+ cognite_neat-0.117.3.dist-info/WHEEL,sha256=XbeZDeTWKc1w7CSIyre5aMDU_-PohRwTQceYnisIYYY,88
185
+ cognite_neat-0.117.3.dist-info/entry_points.txt,sha256=SsQlnl8SNMSSjE3acBI835JYFtsIinLSbVmHmMEXv6E,51
186
+ cognite_neat-0.117.3.dist-info/RECORD,,