ds-caselaw-marklogic-api-client 27.3.0__py3-none-any.whl → 27.4.0__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.
caselawclient/Client.py CHANGED
@@ -62,6 +62,8 @@ except importlib.metadata.PackageNotFoundError:
62
62
  VERSION = "0"
63
63
  DEFAULT_USER_AGENT = f"ds-caselaw-marklogic-api-client/{VERSION}"
64
64
 
65
+ DEBUG: bool = bool(os.getenv("DEBUG", default=False))
66
+
65
67
 
66
68
  class NoResponse(Exception):
67
69
  """A requests HTTPError has no response. We expect this will never happen."""
@@ -728,6 +730,10 @@ class MarklogicApiClient:
728
730
  "vars": vars,
729
731
  }
730
732
  path = "LATEST/eval"
733
+
734
+ if DEBUG:
735
+ print(f"Sending {vars} to {xquery_path}")
736
+
731
737
  response = self.session.request(
732
738
  "POST",
733
739
  url=self._path_to_request_url(path),
@@ -11,20 +11,26 @@ xdmp:to-json(xdmp:sql(
11
11
  "SELECT process_data.uri, enrich_version_string, minutes_since_enrichment_request
12
12
  FROM (
13
13
  SELECT
14
+ propertysummary.published,
14
15
  process_data.uri,
15
16
  enrich_version_string, enrich_major_version, enrich_minor_version,
16
17
  parser_major_version, parser_minor_version,
17
18
  DATEDIFF('minute', last_sent_to_enrichment, CURRENT_TIMESTAMP) AS minutes_since_enrichment_request
18
19
  FROM documents.process_data
19
20
  JOIN documents.process_property_data ON process_data.uri = process_property_data.uri
21
+ JOIN documents.propertysummary ON process_data.uri = propertysummary.uri
20
22
  )
21
- WHERE (
22
- (enrich_version_string IS NULL) OR
23
- (enrich_major_version <= @target_enrichment_major_version AND enrich_minor_version < @target_enrichment_minor_version)
24
- ) AND (
25
- (parser_major_version = @target_parser_major_version AND parser_minor_version = @target_parser_minor_version)
26
- )
27
- AND (minutes_since_enrichment_request > 43200 OR minutes_since_enrichment_request IS NULL)
23
+ WHERE
24
+ (minutes_since_enrichment_request > 43200 OR minutes_since_enrichment_request IS NULL) AND
25
+ (propertysummary.published = 'true') AND
26
+ ( enrich_version_string IS NULL
27
+ OR
28
+ (
29
+ (enrich_major_version <= @target_enrichment_major_version AND enrich_minor_version < @target_enrichment_minor_version)
30
+ AND
31
+ (parser_major_version = @target_parser_major_version AND parser_minor_version = @target_parser_minor_version)
32
+ )
33
+ )
28
34
  ORDER BY enrich_major_version ASC NULLS FIRST, enrich_minor_version ASC
29
35
  LIMIT @maximum_records",
30
36
  "array",
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: ds-caselaw-marklogic-api-client
3
- Version: 27.3.0
3
+ Version: 27.4.0
4
4
  Summary: An API client for interacting with the underlying data in Find Caselaw.
5
5
  Home-page: https://github.com/nationalarchives/ds-caselaw-custom-api-client
6
6
  Keywords: national archives,caselaw
@@ -1,4 +1,4 @@
1
- caselawclient/Client.py,sha256=oMWfL0FwKdWyMtk_0qf6uxWJvsHLSps8vxDsAC9GxeI,40668
1
+ caselawclient/Client.py,sha256=05vFmk39Gy23i-Mo04pZk_3EmsTe_2feIiwd7fXjDpM,40797
2
2
  caselawclient/__init__.py,sha256=DY-caubLDQWWingSdsBWgovDNXh8KcnkI6kwz08eIFk,612
3
3
  caselawclient/client_helpers/__init__.py,sha256=fyDNKCdrTb2N0Ks23YDhmvlXKfLTHnYQCXhnZb-QQbg,3832
4
4
  caselawclient/client_helpers/search_helpers.py,sha256=R99HyRLeYHgsw2L3DOidEqlKLLvs6Tga5rKTuWQViig,1525
@@ -41,7 +41,7 @@ caselawclient/xquery/get_judgment.xqy,sha256=8V-sEFKmtpf2LIZD9QKVRfpblEsmDpP4BA6
41
41
  caselawclient/xquery/get_judgment_checkout_status.xqy,sha256=mdY9UXLyzQdB7byEERPqentlr0YDLbXRVqH0h4UuZTQ,193
42
42
  caselawclient/xquery/get_judgment_version.xqy,sha256=wF9k9-CBrqo8VbxxyTrD-AGzR3-3jMm25tRVCjxPLrU,292
43
43
  caselawclient/xquery/get_last_modified.xqy,sha256=8fCm_7o_kkytCEmEeSTLWzLP7iOjuPV01IfHDgf6HaQ,172
44
- caselawclient/xquery/get_pending_enrichment_for_version.xqy,sha256=S5r5h1iyn_wDQXLEh2MzK8qQ1Jiq-1lRsKgDa8L16yY,1821
44
+ caselawclient/xquery/get_pending_enrichment_for_version.xqy,sha256=8J5Pi-jMXJd_BgtpK4g6C9uR99HP57JpFv5WkoPfNuo,2016
45
45
  caselawclient/xquery/get_pending_parse_for_version.xqy,sha256=9cjVZtHeBBjm-a7RMsn1PVJt_Ug78YFlmp5CN8VJ1jQ,1197
46
46
  caselawclient/xquery/get_properties_for_search_results.xqy,sha256=Tlv3EKwVV_q-JyQyhjWVHIleicPDpucxP4ScuQjpgSw,625
47
47
  caselawclient/xquery/get_property.xqy,sha256=RHlOTrK0aH-S7s_ykYzGmUeKOJxXlI4vE5sKRt556NY,209
@@ -66,7 +66,7 @@ caselawclient/xquery/validate_document.xqy,sha256=PgaDcnqCRJPIVqfmWsNlXmCLNKd21q
66
66
  caselawclient/xquery/xslt.xqy,sha256=w57wNijH3dkwHkpKeAxqjlghVflQwo8cq6jS_sm-erM,199
67
67
  caselawclient/xquery/xslt_transform.xqy,sha256=smyFFxqmtkuOzBd2l7uw6K2oAsYctudrP8omdv_XNAM,2463
68
68
  caselawclient/xquery_type_dicts.py,sha256=AUEmycChASKl8sbqVQWe6WA0s-lIfEqh9mA-GdnUCQ8,5692
69
- ds_caselaw_marklogic_api_client-27.3.0.dist-info/LICENSE.md,sha256=fGMzyyLuQW-IAXUeDSCrRdsYW536aEWThdbpCjo6ZKg,1108
70
- ds_caselaw_marklogic_api_client-27.3.0.dist-info/METADATA,sha256=GltSiGOxA1e5fTsNbAdFhCjVwxQe7XAWS__-eZ165AM,4232
71
- ds_caselaw_marklogic_api_client-27.3.0.dist-info/WHEEL,sha256=7Z8_27uaHI_UZAc4Uox4PpBhQ9Y5_modZXWMxtUi4NU,88
72
- ds_caselaw_marklogic_api_client-27.3.0.dist-info/RECORD,,
69
+ ds_caselaw_marklogic_api_client-27.4.0.dist-info/LICENSE.md,sha256=fGMzyyLuQW-IAXUeDSCrRdsYW536aEWThdbpCjo6ZKg,1108
70
+ ds_caselaw_marklogic_api_client-27.4.0.dist-info/METADATA,sha256=9acabO_PzOjK3LScvlra8WgiyVnNRb7ItdcjIBs1zsg,4232
71
+ ds_caselaw_marklogic_api_client-27.4.0.dist-info/WHEEL,sha256=7Z8_27uaHI_UZAc4Uox4PpBhQ9Y5_modZXWMxtUi4NU,88
72
+ ds_caselaw_marklogic_api_client-27.4.0.dist-info/RECORD,,