udata 9.0.1.dev29853__py2.py3-none-any.whl → 9.0.1.dev29871__py2.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 udata might be problematic. Click here for more details.

Files changed (37) hide show
  1. udata/api/commands.py +0 -2
  2. udata/core/dataservices/rdf.py +2 -5
  3. udata/core/dataset/models.py +1 -2
  4. udata/core/dataset/rdf.py +2 -3
  5. udata/features/notifications/__init__.py +0 -1
  6. udata/harvest/api.py +1 -1
  7. udata/harvest/backends/base.py +3 -4
  8. udata/harvest/backends/dcat.py +0 -1
  9. udata/rdf.py +0 -1
  10. udata/static/chunks/{11.7266fef2dddc1db403d9.js → 11.ae54612e36c6d46f85db.js} +3 -3
  11. udata/static/chunks/{11.7266fef2dddc1db403d9.js.map → 11.ae54612e36c6d46f85db.js.map} +1 -1
  12. udata/static/chunks/{13.91b177d7d531fd55cf5d.js → 13.d8ccb992a49875966313.js} +2 -2
  13. udata/static/chunks/{13.91b177d7d531fd55cf5d.js.map → 13.d8ccb992a49875966313.js.map} +1 -1
  14. udata/static/chunks/{16.e866757bab9f6b0a3f1b.js → 16.4565605e68bab129a471.js} +2 -2
  15. udata/static/chunks/{16.e866757bab9f6b0a3f1b.js.map → 16.4565605e68bab129a471.js.map} +1 -1
  16. udata/static/chunks/{19.619b83ac597516dcd03e.js → 19.f993a75d5bfe2382548d.js} +3 -3
  17. udata/static/chunks/{19.619b83ac597516dcd03e.js.map → 19.f993a75d5bfe2382548d.js.map} +1 -1
  18. udata/static/chunks/{5.48417db6b33328fa9d6a.js → 5.cc2e7bf65ef32f9c8604.js} +3 -3
  19. udata/static/chunks/{5.48417db6b33328fa9d6a.js.map → 5.cc2e7bf65ef32f9c8604.js.map} +1 -1
  20. udata/static/chunks/{6.f84539bd4c419b36cc19.js → 6.cad898a38692eda28965.js} +3 -3
  21. udata/static/chunks/{6.f84539bd4c419b36cc19.js.map → 6.cad898a38692eda28965.js.map} +1 -1
  22. udata/static/chunks/{9.07503e7f7ec02919f696.js → 9.d5b992e9ef51921aeb57.js} +2 -2
  23. udata/static/chunks/{9.07503e7f7ec02919f696.js.map → 9.d5b992e9ef51921aeb57.js.map} +1 -1
  24. udata/static/common.js +1 -1
  25. udata/static/common.js.map +1 -1
  26. udata/storage/s3.py +3 -3
  27. udata/tests/api/test_dataservices_api.py +0 -1
  28. udata/tests/frontend/test_auth.py +1 -4
  29. udata/tests/organization/test_csv_adapter.py +0 -1
  30. udata/tests/site/test_site_api.py +0 -1
  31. udata/tests/test_utils.py +1 -1
  32. {udata-9.0.1.dev29853.dist-info → udata-9.0.1.dev29871.dist-info}/METADATA +1 -1
  33. {udata-9.0.1.dev29853.dist-info → udata-9.0.1.dev29871.dist-info}/RECORD +37 -37
  34. {udata-9.0.1.dev29853.dist-info → udata-9.0.1.dev29871.dist-info}/LICENSE +0 -0
  35. {udata-9.0.1.dev29853.dist-info → udata-9.0.1.dev29871.dist-info}/WHEEL +0 -0
  36. {udata-9.0.1.dev29853.dist-info → udata-9.0.1.dev29871.dist-info}/entry_points.txt +0 -0
  37. {udata-9.0.1.dev29853.dist-info → udata-9.0.1.dev29871.dist-info}/top_level.txt +0 -0
udata/api/commands.py CHANGED
@@ -1,6 +1,5 @@
1
1
  import logging
2
2
  import os
3
- import time
4
3
 
5
4
  import click
6
5
 
@@ -19,7 +18,6 @@ log = logging.getLogger(__name__)
19
18
  @cli.group('api')
20
19
  def grp():
21
20
  '''API related operations'''
22
- pass
23
21
 
24
22
 
25
23
  def json_to_file(data, filename, pretty=False):
@@ -1,16 +1,13 @@
1
1
 
2
- from datetime import datetime
3
- from typing import List, Optional
4
2
  from rdflib import RDF, BNode, Graph, Literal, URIRef
5
3
 
6
4
  from udata.core.dataservices.models import Dataservice, HarvestMetadata as HarvestDataserviceMetadata
7
5
  from udata.core.dataset.models import Dataset, License
8
6
  from udata.core.dataset.rdf import dataset_to_graph_id, sanitize_html
9
- from udata.harvest.models import HarvestSource
10
- from udata.rdf import DCATAP, TAG_TO_EU_HVD_CATEGORIES, namespace_manager, DCAT, DCT, contact_point_from_rdf, rdf_value, remote_url_from_rdf, themes_from_rdf, url_from_rdf
7
+ from udata.rdf import namespace_manager, DCAT, DCT, contact_point_from_rdf, rdf_value, remote_url_from_rdf, themes_from_rdf, url_from_rdf
11
8
  from udata.uris import endpoint_for
12
9
 
13
- def dataservice_from_rdf(graph: Graph, dataservice: Dataservice, node, all_datasets: List[Dataset]) -> Dataservice :
10
+ def dataservice_from_rdf(graph: Graph, dataservice: Dataservice, node, all_datasets: list[Dataset]) -> Dataservice :
14
11
  '''
15
12
  Create or update a dataset from a RDF/DCAT graph
16
13
  '''
@@ -13,7 +13,6 @@ from pydoc import locate
13
13
  from stringdist import rdlevenshtein
14
14
  from werkzeug.utils import cached_property
15
15
  import requests
16
- from typing import Optional, Tuple
17
16
 
18
17
  from udata.app import cache
19
18
  from udata.core import storages
@@ -964,7 +963,7 @@ class ResourceSchema(object):
964
963
  def assignable_schemas():
965
964
  return [s for s in ResourceSchema.all() if s.get('schema_type') not in NON_ASSIGNABLE_SCHEMA_TYPES]
966
965
 
967
- def get_existing_schema_info_by_url(url: str) -> Optional[Tuple[str, Optional[str]]]:
966
+ def get_existing_schema_info_by_url(url: str) -> tuple[str, str | None] | None:
968
967
  '''
969
968
  Returns the name and the version if exists
970
969
  '''
udata/core/dataset/rdf.py CHANGED
@@ -6,7 +6,6 @@ import json
6
6
  import logging
7
7
 
8
8
  from datetime import date
9
- from typing import Optional, Union
10
9
  from dateutil.parser import parse as parse_dt
11
10
  from flask import current_app
12
11
  from geomet import wkt
@@ -149,7 +148,7 @@ def resource_to_rdf(resource, dataset=None, graph=None, is_hvd=False):
149
148
  return r
150
149
 
151
150
 
152
- def dataset_to_graph_id(dataset: Dataset) -> Union[URIRef, BNode]:
151
+ def dataset_to_graph_id(dataset: Dataset) -> URIRef | BNode:
153
152
  if dataset.harvest and dataset.harvest.uri:
154
153
  return URIRef(dataset.harvest.uri)
155
154
  elif dataset.id:
@@ -585,7 +584,7 @@ def dataset_from_rdf(graph: Graph, dataset=None, node=None):
585
584
 
586
585
  return dataset
587
586
 
588
- def bbox_to_geojson_multipolygon(bbox_as_str: str) -> Optional[dict] :
587
+ def bbox_to_geojson_multipolygon(bbox_as_str: str) -> dict | None:
589
588
  bbox = bbox_as_str.strip().split(',')
590
589
  if len(bbox) != 4:
591
590
  return None
@@ -1,4 +1,3 @@
1
- from importlib import import_module
2
1
 
3
2
  import logging
4
3
 
udata/harvest/api.py CHANGED
@@ -274,7 +274,7 @@ class ScheduleSourceAPI(API):
274
274
  # Handle both syntax: quoted and unquoted
275
275
  try:
276
276
  data = request.json
277
- except BadRequest as e:
277
+ except BadRequest:
278
278
  data = request.data.decode('utf-8')
279
279
  return actions.schedule(ident, data)
280
280
 
@@ -2,7 +2,6 @@ import logging
2
2
  import traceback
3
3
 
4
4
  from datetime import datetime, date, timedelta
5
- from typing import List, Optional
6
5
  from uuid import UUID
7
6
 
8
7
  import requests
@@ -284,7 +283,7 @@ class BaseBackend(object):
284
283
  item.ended = datetime.utcnow()
285
284
  self.save_job()
286
285
 
287
- def update_dataset_harvest_info(self, harvest: Optional[HarvestDatasetMetadata], remote_id: int):
286
+ def update_dataset_harvest_info(self, harvest: HarvestDatasetMetadata | None, remote_id: int):
288
287
  if not harvest:
289
288
  harvest = HarvestDatasetMetadata()
290
289
 
@@ -300,7 +299,7 @@ class BaseBackend(object):
300
299
 
301
300
  return harvest
302
301
 
303
- def update_dataservice_harvest_info(self, harvest: Optional[HarvestDataserviceMetadata], remote_id: int):
302
+ def update_dataservice_harvest_info(self, harvest: HarvestDataserviceMetadata | None, remote_id: int):
304
303
  if not harvest:
305
304
  harvest = HarvestDataserviceMetadata()
306
305
 
@@ -444,7 +443,7 @@ class BaseBackend(object):
444
443
 
445
444
 
446
445
  class LogCatcher(logging.Handler):
447
- records: List[logging.LogRecord]
446
+ records: list[logging.LogRecord]
448
447
 
449
448
  def __init__(self):
450
449
  self.records = []
@@ -6,7 +6,6 @@ import lxml.etree as ET
6
6
  from flask import current_app
7
7
  from datetime import date
8
8
  from typing import Generator
9
- from typing import Generator
10
9
 
11
10
  from udata.rdf import (
12
11
  DCAT, DCT, HYDRA, SPDX, namespace_manager, guess_format, url_from_rdf
udata/rdf.py CHANGED
@@ -364,7 +364,6 @@ def schema_from_rdf(rdf):
364
364
  url = uris.validate(type.identifier.toPython())
365
365
  except uris.ValidationError:
366
366
  pass
367
- pass
368
367
 
369
368
  if url is None:
370
369
  return None