stidapi 1.5.0__tar.gz → 1.5.1__tar.gz

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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: stidapi
3
- Version: 1.5.0
3
+ Version: 1.5.1
4
4
  Summary: Python client for connecting to Equinor STIDapi
5
5
  Author: Åsmund Våge Fannemel
6
6
  Author-email: Åsmund Våge Fannemel <asmf@equinor.com>
@@ -64,6 +64,16 @@ do not change either after resource reads. Separate identities or gateways requi
64
64
  separate processes. Provider initialization is thread-safe, but this does not
65
65
  guarantee that concurrent requests using the connector are thread-safe.
66
66
 
67
+ ## Document-reference errors (1.5.1)
68
+
69
+ `Tag.get_doc_references()` and `Tag.get_doc()` return an empty list only when
70
+ the document-reference endpoint successfully returns an empty JSON array.
71
+ HTTP errors propagate as `requests.HTTPError`; unexpected response shapes
72
+ (including null, an error object, or non-dictionary array entries) raise
73
+ `ValueError` rather than being treated as missing documents. Other connector
74
+ exceptions also propagate. The shared JSON helpers retain their existing behavior
75
+ for other resource methods.
76
+
67
77
  ## Developing / testing
68
78
 
69
79
  Dependency manager uv is preferred for developers. Install with required packages for testing and coverage:
@@ -71,7 +81,8 @@ Dependency manager uv is preferred for developers. Install with required package
71
81
 
72
82
  Call `uv run pytest` to run tests.
73
83
 
74
- Run the offline client lifecycle tests with `uv run pytest -m ci`.
84
+ Run the offline client lifecycle and document-reference tests with
85
+ `uv run pytest -m ci`.
75
86
  The remaining legacy tests are not classified by that marker and include live
76
87
  STID calls requiring authorized access; the full suite is not CI-safe.
77
88
 
@@ -46,6 +46,16 @@ do not change either after resource reads. Separate identities or gateways requi
46
46
  separate processes. Provider initialization is thread-safe, but this does not
47
47
  guarantee that concurrent requests using the connector are thread-safe.
48
48
 
49
+ ## Document-reference errors (1.5.1)
50
+
51
+ `Tag.get_doc_references()` and `Tag.get_doc()` return an empty list only when
52
+ the document-reference endpoint successfully returns an empty JSON array.
53
+ HTTP errors propagate as `requests.HTTPError`; unexpected response shapes
54
+ (including null, an error object, or non-dictionary array entries) raise
55
+ `ValueError` rather than being treated as missing documents. Other connector
56
+ exceptions also propagate. The shared JSON helpers retain their existing behavior
57
+ for other resource methods.
58
+
49
59
  ## Developing / testing
50
60
 
51
61
  Dependency manager uv is preferred for developers. Install with required packages for testing and coverage:
@@ -53,7 +63,8 @@ Dependency manager uv is preferred for developers. Install with required package
53
63
 
54
64
  Call `uv run pytest` to run tests.
55
65
 
56
- Run the offline client lifecycle tests with `uv run pytest -m ci`.
66
+ Run the offline client lifecycle and document-reference tests with
67
+ `uv run pytest -m ci`.
57
68
  The remaining legacy tests are not classified by that marker and include live
58
69
  STID calls requiring authorized access; the full suite is not CI-safe.
59
70
 
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "stidapi"
3
- version = "1.5.0"
3
+ version = "1.5.1"
4
4
  description = "Python client for connecting to Equinor STIDapi"
5
5
  requires-python = ">=3.10,<4"
6
6
  readme = "README.md"
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "stidapi"
3
- version = "1.5.0"
3
+ version = "1.5.1"
4
4
  description = "Python client for connecting to Equinor STIDapi"
5
5
  authors = [{ name = "Åsmund Våge Fannemel", email = "asmf@equinor.com" }]
6
6
  requires-python = ">=3.10,<4"
@@ -209,6 +209,10 @@ class Tag:
209
209
 
210
210
  Returns:
211
211
  List[Doc]: List of referred Documents
212
+
213
+ Raises:
214
+ requests.HTTPError: If the document-reference request fails.
215
+ ValueError: If document references are not a list of dictionaries.
212
216
  """
213
217
  return [Doc.from_data(x) for x in self.get_doc_references()]
214
218
 
@@ -217,12 +221,24 @@ class Tag:
217
221
 
218
222
  Returns:
219
223
  List[dict]: List of dicts describing document references.
224
+
225
+ Raises:
226
+ requests.HTTPError: If the request returns an HTTP error.
227
+ ValueError: If the response is not a list of dictionaries.
220
228
  """
221
229
  url = u.build_url(
222
230
  f"{self.inst_code}/tag/document-refs",
223
231
  {"tagNo": self.tag_no, "noContentAs200": True},
224
232
  )
225
- return [item for item in u.get_json_list(url) if isinstance(item, dict)]
233
+ references = u.get_json(url, raise_for_status=True)
234
+ if not isinstance(references, list) or any(
235
+ not isinstance(item, dict) for item in references
236
+ ):
237
+ raise ValueError(
238
+ f"Invalid document references for {self.inst_code}/{self.tag_no}: "
239
+ "expected a list of dictionaries"
240
+ )
241
+ return references
226
242
 
227
243
  def get_functional_location(self) -> str:
228
244
  """Get functional location of Tagged item or empty string if it does not have a functional location.
File without changes
File without changes
File without changes
File without changes
File without changes