Skip to content

Hua work common - #111

Merged
zaihuaji merged 2 commits into
mainfrom
hua-work-common
Jul 9, 2026
Merged

zaihuaji merged 2 commits into
mainfrom
hua-work-common

Conversation

@zaihuaji

@zaihuaji zaihuaji commented Jul 9, 2026

Copy link
Copy Markdown
Collaborator

No description provided.

zaihuaji and others added 2 commits July 6, 2026 12:45
All datasets are under dsarch control, so use_rdadb gating is no longer
needed.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings July 9, 2026 14:17

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates rda_python_common by removing the use_rdadb helper from both the legacy procedural module and the class-based DBI implementation, and bumps the package version.

Changes:

  • Removed use_rdadb from src/rda_python_common/PgDBI.py.
  • Removed use_rdadb from src/rda_python_common/pg_dbi.py.
  • Bumped project version from 3.0.1 to 3.0.2 in pyproject.toml.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.

File Description
src/rda_python_common/PgDBI.py Removes the use_rdadb public function from the module API.
src/rda_python_common/pg_dbi.py Removes the use_rdadb method from the class-based DBI API.
pyproject.toml Updates the published package version to 3.0.2.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 1717 to 1723
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
Comment on lines 1989 to 1997
def reset_rdadb_version(self, dsid):
"""Increment the version counter for a dataset record in RDADB.

Args:
dsid (str): Dataset ID (e.g. 'd123000').
"""
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):
Comment thread pyproject.toml
Comment on lines 5 to 8
[project]
name = "rda_python_common"
version = "3.0.1"
version = "3.0.2"
authors = [
@zaihuaji
zaihuaji merged commit e1cf008 into main Jul 9, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants