Hua work common - #111
Merged
Merged
Hua work common#111
Conversation
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>
Contributor
There was a problem hiding this comment.
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_rdadbfromsrc/rda_python_common/PgDBI.py. - Removed
use_rdadbfromsrc/rda_python_common/pg_dbi.py. - Bumped project version from
3.0.1to3.0.2inpyproject.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 on lines
5
to
8
| [project] | ||
| name = "rda_python_common" | ||
| version = "3.0.1" | ||
| version = "3.0.2" | ||
| authors = [ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.