From 23e8206581f6cea5ddf1f41dc50b2848def26212 Mon Sep 17 00:00:00 2001 From: zaihuaji Date: Mon, 6 Jul 2026 12:45:09 -0500 Subject: [PATCH 1/2] remove use_rdadb() function All datasets are under dsarch control, so use_rdadb gating is no longer needed. Co-Authored-By: Claude Opus 4.6 --- src/rda_python_common/PgDBI.py | 19 ------------------- src/rda_python_common/pg_dbi.py | 26 -------------------------- 2 files changed, 45 deletions(-) diff --git a/src/rda_python_common/PgDBI.py b/src/rda_python_common/PgDBI.py index 00f9597..aedf00f 100644 --- a/src/rda_python_common/PgDBI.py +++ b/src/rda_python_common/PgDBI.py @@ -1718,25 +1718,6 @@ def reset_rdadb_version(dsid): pgexec("UPDATE dataset SET version = version + 1 WHERE dsid = '{}'".format(dsid), PGDBI['ERRLOG']) -# -# check the use rdadb flag in table dataset for a given dataset and given values -# -def use_rdadb(dsid, logact = 0, vals = None): - - ret = '' # default to empty in case dataset not in RDADB - if dsid: - pgrec = pgget("dataset", "use_rdadb", "dsid = '{}'".format(dsid), PGDBI['EXITLG']) - if pgrec: - ret = 'N' # default to 'N' if dataset record in RDADB already - if pgrec['use_rdadb']: - if not vals: vals = "IPYMW" # default to Internal; Publishable; Yes RDADB - if vals.find(pgrec['use_rdadb']) > -1: - ret = pgrec['use_rdadb'] - elif logact: - PgLOG.pglog("Dataset '{}' is not in RDADB!".format(dsid), logact) - - return ret - # # fld: field name for querry condition # vals: reference to aaray of values diff --git a/src/rda_python_common/pg_dbi.py b/src/rda_python_common/pg_dbi.py index 5880c27..2d7d197 100644 --- a/src/rda_python_common/pg_dbi.py +++ b/src/rda_python_common/pg_dbi.py @@ -1994,32 +1994,6 @@ def reset_rdadb_version(self, dsid): """ self.pgexec("UPDATE dataset SET version = version + 1 WHERE dsid = '{}'".format(dsid), self.PGDBI['ERRLOG']) - def use_rdadb(self, dsid, logact = 0, vals = None): - """Return the use_rdadb flag for a dataset if it matches an allowed set. - - Args: - dsid (str | None): Dataset ID to query. - logact (int): Logging action flags for missing-dataset warnings; default 0. - vals (str | None): Accepted flag characters; defaults to 'IPYMW' when None. - - Returns: - str: The use_rdadb flag character when found and in vals; 'N' when the - dataset exists but the flag is not in vals; '' when dsid is falsy - or the dataset is not in RDADB. - """ - ret = '' # default to empty in case dataset not in RDADB - if dsid: - pgrec = self.pgget("dataset", "use_rdadb", "dsid = '{}'".format(dsid), self.PGDBI['EXITLG']) - if pgrec: - ret = 'N' # default to 'N' if dataset record in RDADB already - if pgrec['use_rdadb']: - if not vals: vals = "IPYMW" # default to Internal; Publishable; Yes RDADB - if vals.find(pgrec['use_rdadb']) > -1: - ret = pgrec['use_rdadb'] - elif logact: - self.pglog("Dataset '{}' is not in RDADB!".format(dsid), logact) - return ret - def get_field_condition(self, fld, vals, isstr = 0, noand = 0): """Build a SQL condition fragment for a field given a list of values. From 1a6a4282830fdcb8e279e3f003ec1f3ff619c420 Mon Sep 17 00:00:00 2001 From: zaihuaji Date: Mon, 6 Jul 2026 12:47:13 -0500 Subject: [PATCH 2/2] bump version to 3.0.2 Co-Authored-By: Claude Opus 4.6 --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 3ad249d..a115819 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta" [project] name = "rda_python_common" -version = "3.0.1" +version = "3.0.2" authors = [ { name="Zaihua Ji", email="zji@ucar.edu" }, ]