From 0cd7ad8e024daf83f81e138888c3bd1423099472 Mon Sep 17 00:00:00 2001 From: Vincent Fazio Date: Mon, 28 Sep 2026 11:46:44 +0800 Subject: [PATCH 1/9] Debug DOI extension --- ckan/Dockerfile | 2 +- ckan/Dockerfile.dev | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ckan/Dockerfile b/ckan/Dockerfile index c4258bb09..03a6214ab 100644 --- a/ckan/Dockerfile +++ b/ckan/Dockerfile @@ -56,7 +56,7 @@ RUN pip install -e "git+https://github.com/ckan/ckanext-spatial.git#egg=ckanext- RUN pip install future ### DOI extension ### -RUN pip install -e "git+https://github.com/AuScope/ckanext-doi.git@auscope_customise#egg=ckanext-doi" +RUN pip install -e "git+https://github.com/AuScope/ckanext-doi.git@auscope_customise_debug#egg=ckanext-doi" ### ISO19115 extension ### RUN pip install -e "git+https://github.com/AuScope/ckanext-iso19115.git@auscope_data_repo_customise#egg=ckanext-iso19115" diff --git a/ckan/Dockerfile.dev b/ckan/Dockerfile.dev index 290aca2ba..b1f24f8f5 100644 --- a/ckan/Dockerfile.dev +++ b/ckan/Dockerfile.dev @@ -50,7 +50,7 @@ RUN pip install -e "git+https://github.com/ckan/ckanext-spatial.git#egg=ckanext- RUN pip install future ### DOI extension ### -RUN pip install -e "git+https://github.com/AuScope/ckanext-doi.git@auscope_customise#egg=ckanext-doi" +RUN pip install -e "git+https://github.com/AuScope/ckanext-doi.git@auscope_customise_debug#egg=ckanext-doi" ### ISO19115 extension ### RUN pip install -e "git+https://github.com/AuScope/ckanext-iso19115.git@auscope_data_repo_customise#egg=ckanext-iso19115" From cc0c652f33978399ec8ebd0679f4e6229a9015f4 Mon Sep 17 00:00:00 2001 From: Vincent Fazio Date: Mon, 28 Sep 2026 13:51:44 +0800 Subject: [PATCH 2/9] Add comments to batch processing functions --- .../ckanext/igsn_theme/logic/batch_process.py | 105 ++++++++++++++++++ 1 file changed, 105 insertions(+) diff --git a/ckan/src/ckanext-igsn-theme/ckanext/igsn_theme/logic/batch_process.py b/ckan/src/ckanext-igsn-theme/ckanext/igsn_theme/logic/batch_process.py index 233980b3d..67c3d10dd 100644 --- a/ckan/src/ckanext-igsn-theme/ckanext/igsn_theme/logic/batch_process.py +++ b/ckan/src/ckanext-igsn-theme/ckanext/igsn_theme/logic/batch_process.py @@ -65,6 +65,12 @@ def read_job_state(job_id): def batch_save_job(job_id, data, user_name, org_id): + """Wrapper around :func:`_batch_save_job` that records failures to disk. + + Runs the batch save job and, if any exception (including ``SystemExit``) + is raised, persists a ``failed`` job state before re-raising so the status + endpoint can report the error. + """ try: _batch_save_job(job_id, data, user_name, org_id) except SystemExit as exc: @@ -196,6 +202,15 @@ def _serialisable_samples(samples): def generate_location_geojson(coordinates_list): + """Build a GeoJSON FeatureCollection of points from *coordinates_list*. + + Args: + coordinates_list (list): Iterable of ``(lat, lng)`` tuples. + + Returns: + dict: A GeoJSON ``FeatureCollection`` with one Point feature per + coordinate pair. + """ features = [] for lat, lng in coordinates_list: point_feature = { @@ -215,11 +230,42 @@ def generate_location_geojson(coordinates_list): return feature_collection def process_author_emails(sample, authors_df): + """Return JSON author records matching the emails listed on *sample*. + + Splits the semicolon-separated ``author_emails`` field of *sample*, + looks up the matching rows in *authors_df*, and returns them as a JSON + string. + + Args: + sample (dict): Sample row containing an ``author_emails`` field. + authors_df (pandas.DataFrame): Author records keyed by + ``author_email``. + + Returns: + str: JSON-encoded list of matched author records. + """ author_emails = [email.strip() for email in sample.get("author_emails", "").split(";")] matched_authors = authors_df[authors_df["author_email"].isin(author_emails)] return json.dumps(matched_authors.to_dict("records")) def prepare_samples_data(samples_df, authors_df, related_resources_df, funding_df, org_id): + """Transform spreadsheet rows into CKAN package dicts ready for creation. + + Iterates over *samples_df*, enriching each row with author, related + resource and funding data from the other DataFrames, resolving EPSG + names, building location GeoJSON, applying default publisher fields, + and generating each sample's name and title. + + Args: + samples_df (pandas.DataFrame): One row per sample. + authors_df (pandas.DataFrame): Author records. + related_resources_df (pandas.DataFrame): Related resource records. + funding_df (pandas.DataFrame): Funding/project records. + org_id (str): Organisation ID owning the samples. + + Returns: + list: List of sample data dicts suitable for ``package_create``. + """ samples_data = [] # Keep a dictionary to cache EPSG names to avoid repeated API calls for the same EPSG code current_epsg_dict = {} @@ -273,6 +319,23 @@ def prepare_samples_data(samples_df, authors_df, related_resources_df, funding_d return samples_data def process_related_resources(sample, related_resources_df): + """Return JSON related-resource records for the URLs listed on *sample*. + + Splits the semicolon-separated ``related_resources_urls`` field, validates + each URL and its required fields, and returns the matching rows from + *related_resources_df* as a JSON string. + + Args: + sample (dict): Sample row containing a ``related_resources_urls`` field. + related_resources_df (pandas.DataFrame): Related resource records keyed + by ``related_resource_url``. + + Returns: + str: JSON-encoded list of matched related resources (``"[]"`` if none). + + Raises: + ValueError: If a URL is invalid or required fields are missing. + """ related_resources_urls = sample.get("related_resources_urls") if is_cell_empty(related_resources_urls): return "[]" @@ -289,6 +352,24 @@ def process_related_resources(sample, related_resources_df): return json.dumps(matched_resources.to_dict("records")) def process_funding_info(sample, funding_df): + """Return JSON funding records for the project IDs listed on *sample*. + + Splits the semicolon-separated ``project_ids`` field, validates that each + project has the required funding fields in *funding_df*, and returns the + matching rows as a JSON string. + + Args: + sample (dict): Sample row containing a ``project_ids`` field. + funding_df (pandas.DataFrame): Funding records keyed by + ``project_identifier``. + + Returns: + str: JSON-encoded list of matched funding records (``"[]"`` if none). + + Raises: + ValueError: If funding information is missing or incomplete for a + referenced project ID. + """ if not is_cell_empty(sample.get("project_ids")): project_ids = [project_id.strip() for project_id in sample.get("project_ids").split(";")] for project_id in project_ids: @@ -310,7 +391,19 @@ def process_funding_info(sample, funding_df): # matched_funder_name = funding_df.loc[funding_df["project_identifier"].isin(project_ids), "funder_name"] # return matched_funder_name.tolist() return "[]" + def get_epsg_name(epsg_code): + """Look up the human-readable EPSG name for *epsg_code*. + + Queries the EPSG registry API and returns the name of the first + matching coordinate reference system. + + Args: + epsg_code: EPSG code to look up. + + Returns: + str or None: The EPSG name, or ``None`` if the request fails. + """ external_url = f'https://apps.epsg.org/api/v1/CoordRefSystem/?includeDeprecated=false&pageSize=50&page={0}&keywords={epsg_code}' response = requests.get(external_url) if response.ok: @@ -442,6 +535,18 @@ def get_created_sample_id(preview_sample): return None def read_excel_sheets(excel_data, sheets): + """Read the requested *sheets* from an Excel file into DataFrames. + + Each sheet is read with ``na_filter=False``; unreadable or empty sheets + map to an empty DataFrame rather than raising. + + Args: + excel_data: A file-like object containing the Excel workbook. + sheets (list): Names of the sheets to read. + + Returns: + dict: Mapping of sheet name to its ``pandas.DataFrame``. + """ dfs = {} for sheet in sheets: excel_data.seek(0) From 41ebbd6a246eefb57547d478d1e916915a7daf6a Mon Sep 17 00:00:00 2001 From: Stuart Woodman Date: Thu, 17 Sep 2026 11:13:27 +1000 Subject: [PATCH 3/9] * Fixed issue of iso19115 interface not working (https://jira.csiro.au/browse/AUS-4664) by removing pyproj version restriction. * Included iso19115 in env ckanext definition. * Fix override scripts DB_HOST definitions. * Bump geojson and OWSLib library versions in spatial-reqs.txt. * Update composite-repeating-module.js ROR queries for new ROR request URL and new response. * Change dev minio image location. --- .env.dev | 2 +- .env.example | 2 +- ckan/spatial-reqs.txt | 11 +++-------- .../public/base/js/composite-repeating-module.js | 8 ++++---- docker-compose.dev.yml | 2 +- 5 files changed, 10 insertions(+), 15 deletions(-) diff --git a/.env.dev b/.env.dev index e9a06990d..e90c65581 100644 --- a/.env.dev +++ b/.env.dev @@ -86,7 +86,7 @@ CKAN__LICENSES_GROUP_URL= file:///shared/public/licenses.json CKAN__DISPLAY_TIMEZONE=Australia/Sydney # Extensions -CKAN__PLUGINS="envvars oidc_pkce auscope_theme contact scheming_datasets scheming_organizations composite image_view text_view recline_view datastore datapusher spatial_metadata spatial_query doi dcat dcat_json_interface structured_data" +CKAN__PLUGINS="envvars oidc_pkce auscope_theme contact scheming_datasets scheming_organizations composite image_view text_view recline_view datastore datapusher spatial_metadata spatial_query doi dcat dcat_json_interface structured_data iso19115" # CKAN__PLUGINS="envvars oidc_pkce igsn_theme contact scheming_datasets scheming_organizations composite image_view text_view recline_view datastore datapusher spatial_metadata spatial_query doi dcat dcat_json_interface structured_data" diff --git a/.env.example b/.env.example index 829d1af40..ceaf11780 100644 --- a/.env.example +++ b/.env.example @@ -89,7 +89,7 @@ CKAN__LICENSES_GROUP_URL= file:///shared/public/licenses.json # To switch themes between igsn-theme and auscope-theme, # comment out one CKAN__PLUGINS line and uncomment the other. # For Auscope Theme -CKAN__PLUGINS="envvars oidc_pkce auscope_theme contact scheming_datasets composite zip_view image_view text_view recline_view datastore datapusher spatial_metadata spatial_query doi" +CKAN__PLUGINS="envvars oidc_pkce auscope_theme contact scheming_datasets composite zip_view image_view text_view recline_view datastore datapusher spatial_metadata spatial_query doi iso19115" # For IGSN Theme # CKAN__PLUGINS="envvars oidc_pkce igsn_theme contact scheming_datasets composite zip_view image_view text_view recline_view datastore datapusher spatial_metadata spatial_query doi" diff --git a/ckan/spatial-reqs.txt b/ckan/spatial-reqs.txt index 2f885aed0..eddc54ec6 100755 --- a/ckan/spatial-reqs.txt +++ b/ckan/spatial-reqs.txt @@ -5,11 +5,6 @@ pyparsing>=2.1.10 requests>=1.1.0 six cython==0.29.36; python_version < '3.9' -pyproj==2.6.1; python_version < '3.9' -# Require specific version of pyproj as latest requires PROJ < 9.2 -pyproj @ git+https://github.com/pyproj4/pyproj.git@b84639b0cb1928579648fb0687b212d007a3b9ca; python_version >= '3.9' - -Shapely~=2.1.2 -OWSLib~=0.32.0 -geojson~=3.1 - +Shapely +OWSLib>=0.32,<0.33 +geojson>=3.0.1,<3.2 diff --git a/ckan/src/shared/public/base/js/composite-repeating-module.js b/ckan/src/shared/public/base/js/composite-repeating-module.js index c70c9af36..9c11ac8ff 100644 --- a/ckan/src/shared/public/base/js/composite-repeating-module.js +++ b/ckan/src/shared/public/base/js/composite-repeating-module.js @@ -87,24 +87,24 @@ ckan.module('composite-repeating-module', function ($, _) { dataType: 'json', delay: 250, data: function (params) { - return { affiliation: params }; + return { query: params }; }, processResults: function (data) { return { results: $.map(data.items, function (item) { let anyName = "Unknown" // An organisation has lots of names, acronyms and aliases - for (const name of item.organization.names) { + for (const name of item.names) { // But we only want the 'ror_display' name type for (const type of name.types) { if (type === 'ror_display') { - return { id: item.organization.id, text: name.value }; + return { id: item.id, text: name.value }; } } anyName = name.value; } // If there is no 'ror_display' name type - return { id: item.organization.id, text: anyName }; + return { id: item.id, text: anyName }; }) }; }, diff --git a/docker-compose.dev.yml b/docker-compose.dev.yml index 81f19f80f..ba9fc116c 100755 --- a/docker-compose.dev.yml +++ b/docker-compose.dev.yml @@ -80,7 +80,7 @@ services: test: ["CMD", "redis-cli", "-e", "QUIT"] minio: - image: minio/minio + image: quay.io/minio/minio container_name: minio restart: unless-stopped ports: From 9aefcb6ba2459f860aeeb30a7685c684b2abe690 Mon Sep 17 00:00:00 2001 From: Vincent Fazio Date: Mon, 28 Sep 2026 15:34:53 +0800 Subject: [PATCH 4/9] Batch processed samples must be updated to mint a DOI --- .../ckanext/igsn_theme/logic/action.py | 17 +++++++++---- .../ckanext/igsn_theme/logic/batch_process.py | 25 +++++++++++++++++++ 2 files changed, 37 insertions(+), 5 deletions(-) diff --git a/ckan/src/ckanext-igsn-theme/ckanext/igsn_theme/logic/action.py b/ckan/src/ckanext-igsn-theme/ckanext/igsn_theme/logic/action.py index 0616d2a15..501e47d51 100644 --- a/ckan/src/ckanext-igsn-theme/ckanext/igsn_theme/logic/action.py +++ b/ckan/src/ckanext-igsn-theme/ckanext/igsn_theme/logic/action.py @@ -103,12 +103,19 @@ def package_update(next_action, context, data_dict): manage_parent_related_resource(data_dict) package = get_package_object(context, {'id': data_dict['id']}) - - # If package being made public for first time, set publication date - if package.private and data_dict['private'] == 'False' and \ - (not data_dict['publication_date'] or data_dict['publication_date'] == ''): + + # If package being made public for first time, set publication date. + # + # ``private`` may arrive as a real bool (``False``) or as a string + # (``'False'``/``'false'``) depending on the caller (web form vs. batch job + # vs. a package_show round-trip), so normalise before comparing. Also read + # publication_date with .get() to avoid a KeyError when the key is absent. + incoming_private = data_dict.get('private') + is_public = incoming_private in (False, 'False', 'false') + publication_date = data_dict.get('publication_date') + if package.private and is_public and not publication_date: data_dict['publication_date'] = datetime.now() - + return next_action(context, data_dict) logger = logging.getLogger(__name__) diff --git a/ckan/src/ckanext-igsn-theme/ckanext/igsn_theme/logic/batch_process.py b/ckan/src/ckanext-igsn-theme/ckanext/igsn_theme/logic/batch_process.py index 67c3d10dd..0daad7748 100644 --- a/ckan/src/ckanext-igsn-theme/ckanext/igsn_theme/logic/batch_process.py +++ b/ckan/src/ckanext-igsn-theme/ckanext/igsn_theme/logic/batch_process.py @@ -173,6 +173,31 @@ def _batch_save_job(job_id, data, user_name, org_id): except Exception as exc: log.error("batch_save_job: set_parent_sample failed: %s", exc) + # Mint DOIs for successfully created samples. + # + # The ckanext-doi extension only mints/publishes a DOI on DataCite from its + # ``after_dataset_update`` hook; ``after_dataset_create`` merely reserves a + # local DOI record. Because this batch job creates samples with + # ``package_create`` and (for parentless samples) never issues a subsequent + # ``package_update``, that hook never fires and DOIs are never minted. + # + # Trigger one ``package_update`` per created sample so the DOI hook runs. + # We reload each package via ``package_show`` first (mirroring + # ``set_parent_sample_with_data``) so the dict has correctly-typed ``state``, + # ``private`` and ``publication_date`` values. The DOI hook is idempotent: + # it only mints when the DOI is unpublished and otherwise just checks the + # metadata, so updating an already-parented sample again is safe. + if unsuccessful_creations == 0: + for created in created_sample_ids: + try: + pkg = toolkit.get_action('package_show')(context, {'id': created['id']}) + toolkit.get_action('package_update')(context, pkg) + except Exception as exc: + log.error( + "batch_save_job: DOI-minting update failed for %s: %s", + created['id'], exc, + ) + final_status = 'complete' if unsuccessful_creations == 0 else 'failed' write_job_state(job_id, { 'status': final_status, From f476d70fa1847eb2c9e81837ce5f2e565a59dd8a Mon Sep 17 00:00:00 2001 From: Vincent Fazio Date: Tue, 29 Sep 2026 14:10:37 +0800 Subject: [PATCH 5/9] AUS-4678 Reduce size of log output --- ckan/src/ckanext-igsn-theme/ckanext/igsn_theme/views.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ckan/src/ckanext-igsn-theme/ckanext/igsn_theme/views.py b/ckan/src/ckanext-igsn-theme/ckanext/igsn_theme/views.py index 83ca9fd17..612f4c241 100644 --- a/ckan/src/ckanext-igsn-theme/ckanext/igsn_theme/views.py +++ b/ckan/src/ckanext-igsn-theme/ckanext/igsn_theme/views.py @@ -205,7 +205,7 @@ def post(self): if not preview_data or not preview_data.get('samples') or not isinstance(preview_data['samples'], list): h.flash_error(_('Please generate a preview first.'), 'error') return redirect(url_for('igsn_theme.batch_upload', group=org_id)) - log.info(f"First 2 of preview data retrieved from session for saving: {preview_data['samples'][:2]}") + log.debug(f"First 2 of preview data retrieved from session for saving: {preview_data['samples'][:2]}") log.info(f"{len(preview_data['samples'])=}") log.info(f"File name retrieved from session for saving: {file_name}") From 9310d83afdf4528481f5514f717fc18f2aa430cc Mon Sep 17 00:00:00 2001 From: Vincent Fazio Date: Tue, 29 Sep 2026 14:14:46 +0800 Subject: [PATCH 6/9] AUS-4678 When updating in batch_process, flag that there's no UI --- .../ckanext/igsn_theme/logic/batch_process.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/ckan/src/ckanext-igsn-theme/ckanext/igsn_theme/logic/batch_process.py b/ckan/src/ckanext-igsn-theme/ckanext/igsn_theme/logic/batch_process.py index 0daad7748..e3b9b9ebc 100644 --- a/ckan/src/ckanext-igsn-theme/ckanext/igsn_theme/logic/batch_process.py +++ b/ckan/src/ckanext-igsn-theme/ckanext/igsn_theme/logic/batch_process.py @@ -100,9 +100,13 @@ def _batch_save_job(job_id, data, user_name, org_id): context = { 'user': user_name, 'ignore_auth': False, + # This job runs in a background RQ worker with no Flask request + # context. ckanext-doi's after_dataset_update flashes a success message + # on mint/update, which would raise "Working outside of request + # context". Signal the DOI hook to skip flashing. + 'defer_flash': True, } - print(f"PRINT batch_save_job started for job_id={job_id}, {len(data)} samples", flush=True) - #log.info("batch_save_job started for job_id=%s, %d samples", job_id, len(data)) + log.info("batch_save_job started for job_id=%s, %d samples", job_id, len(data)) write_job_state(job_id, { 'status': 'running', 'total': len(data), @@ -120,8 +124,7 @@ def _batch_save_job(job_id, data, user_name, org_id): for i, sample_data in enumerate(data): _error_occurred = False try: - print(f"batch_save_job: creating sample {i + 1}/{len(data)}", flush=True) - #log.info("batch_save_job: creating sample %d/%d", i + 1, len(data)) + log.info("batch_save_job: creating sample %d/%d", i + 1, len(data)) created_sample = get_action('package_create')(context, sample_data) created_sample_ids.append({ 'id': created_sample['id'], From 78f4a945fba4a733ab3bf72b291d527de585cea0 Mon Sep 17 00:00:00 2001 From: Vincent Fazio Date: Tue, 29 Sep 2026 14:18:27 +0800 Subject: [PATCH 7/9] AUS-4678 Fix db exception when aquisition date is 'None' --- .../ckanext-igsn-theme/ckanext/igsn_theme/logic/action.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/ckan/src/ckanext-igsn-theme/ckanext/igsn_theme/logic/action.py b/ckan/src/ckanext-igsn-theme/ckanext/igsn_theme/logic/action.py index 501e47d51..37a31d0a1 100644 --- a/ckan/src/ckanext-igsn-theme/ckanext/igsn_theme/logic/action.py +++ b/ckan/src/ckanext-igsn-theme/ckanext/igsn_theme/logic/action.py @@ -44,7 +44,7 @@ def organization_list_for_user(next_action, context, data_dict): @tk.chained_action def package_create(next_action, context, data_dict): - logger = logging.getLogger(__name__) + # logger = logging.getLogger(__name__) # logger.info("package_create before data_dict: %s", pformat(data_dict)) package_type = data_dict.get('type') @@ -77,6 +77,8 @@ def package_create(next_action, context, data_dict): acquisition_start_date = acquisition_start_date.strftime('%Y-%m-%d') if isinstance(acquisition_start_date, str): acquisition_start_date = acquisition_start_date.strip() + if acquisition_start_date is None: + acquisition_start_date = '' data_dict['acquisition_start_date'] = acquisition_start_date if 'acquisition_end_date' in data_dict: @@ -85,6 +87,8 @@ def package_create(next_action, context, data_dict): acquisition_end_date = acquisition_end_date.strftime('%Y-%m-%d') if isinstance(acquisition_end_date, str): acquisition_end_date = acquisition_end_date.strip() + if acquisition_end_date is None: + acquisition_end_date = '' data_dict['acquisition_end_date'] = acquisition_end_date From 9709cb45a408f91a8dbee7c1a8f3c3a249b37b9b Mon Sep 17 00:00:00 2001 From: Vincent Fazio Date: Tue, 29 Sep 2026 14:31:47 +0800 Subject: [PATCH 8/9] AUS-4678 Revert to non-debug version of DOI extension --- ckan/Dockerfile | 2 +- ckan/Dockerfile.dev | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ckan/Dockerfile b/ckan/Dockerfile index 03a6214ab..c4258bb09 100644 --- a/ckan/Dockerfile +++ b/ckan/Dockerfile @@ -56,7 +56,7 @@ RUN pip install -e "git+https://github.com/ckan/ckanext-spatial.git#egg=ckanext- RUN pip install future ### DOI extension ### -RUN pip install -e "git+https://github.com/AuScope/ckanext-doi.git@auscope_customise_debug#egg=ckanext-doi" +RUN pip install -e "git+https://github.com/AuScope/ckanext-doi.git@auscope_customise#egg=ckanext-doi" ### ISO19115 extension ### RUN pip install -e "git+https://github.com/AuScope/ckanext-iso19115.git@auscope_data_repo_customise#egg=ckanext-iso19115" diff --git a/ckan/Dockerfile.dev b/ckan/Dockerfile.dev index b1f24f8f5..290aca2ba 100644 --- a/ckan/Dockerfile.dev +++ b/ckan/Dockerfile.dev @@ -50,7 +50,7 @@ RUN pip install -e "git+https://github.com/ckan/ckanext-spatial.git#egg=ckanext- RUN pip install future ### DOI extension ### -RUN pip install -e "git+https://github.com/AuScope/ckanext-doi.git@auscope_customise_debug#egg=ckanext-doi" +RUN pip install -e "git+https://github.com/AuScope/ckanext-doi.git@auscope_customise#egg=ckanext-doi" ### ISO19115 extension ### RUN pip install -e "git+https://github.com/AuScope/ckanext-iso19115.git@auscope_data_repo_customise#egg=ckanext-iso19115" From 247ca41c5fb499617cd2bb54349d83f571df30b3 Mon Sep 17 00:00:00 2001 From: Vincent Fazio Date: Tue, 29 Sep 2026 15:38:19 +0800 Subject: [PATCH 9/9] AUS-4678 Clean up excess logging --- .../ckanext/igsn_theme/logic/batch_process.py | 2 -- .../ckanext/igsn_theme/logic/validators.py | 8 ++++---- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/ckan/src/ckanext-igsn-theme/ckanext/igsn_theme/logic/batch_process.py b/ckan/src/ckanext-igsn-theme/ckanext/igsn_theme/logic/batch_process.py index e3b9b9ebc..5df1cbfc8 100644 --- a/ckan/src/ckanext-igsn-theme/ckanext/igsn_theme/logic/batch_process.py +++ b/ckan/src/ckanext-igsn-theme/ckanext/igsn_theme/logic/batch_process.py @@ -115,7 +115,6 @@ def _batch_save_job(job_id, data, user_name, org_id): 'unsuccessful': 0, 'samples': [], }) - print(f"batch_save_job: job state written", flush=True) created_sample_ids = [] successful_creations = 0 @@ -210,7 +209,6 @@ def _batch_save_job(job_id, data, user_name, org_id): 'unsuccessful': unsuccessful_creations, 'samples': _serialisable_samples(data), }) - print(f"batch_save_job finished for job_id={job_id} status={final_status}", flush=True) #log.info("batch_save_job finished for job_id=%s status=%s", job_id, final_status) diff --git a/ckan/src/ckanext-igsn-theme/ckanext/igsn_theme/logic/validators.py b/ckan/src/ckanext-igsn-theme/ckanext/igsn_theme/logic/validators.py index e973b002d..ee767c744 100644 --- a/ckan/src/ckanext-igsn-theme/ckanext/igsn_theme/logic/validators.py +++ b/ckan/src/ckanext-igsn-theme/ckanext/igsn_theme/logic/validators.py @@ -104,18 +104,18 @@ def validator(key, data, errors, context): add_error(errors, elevation_key, invalid_error) try: - logger.debug("location_data: %s", location_data) + # logger.debug("location_data: %s", location_data) geom = shape(location_data['features'][0]['geometry']) - logger.debug("WKT for spatial field: %s", geom.wkt) + # logger.debug("WKT for spatial field: %s", geom.wkt) geojson_geom = geojson.dumps(mapping(geom)) - logger.debug("GeoJSON for spatial field: %s", geojson_geom) + # logger.debug("GeoJSON for spatial field: %s", geojson_geom) data['spatial',] = geojson_geom - logger.debug("Data after setting spatial: %s", pformat(data)) + # logger.debug("Data after setting spatial: %s", pformat(data)) except Exception as e: logger.error("Error processing GeoJSON: %s", e)