Skip to content

Conversation

pangpang20
Copy link
Collaborator

Description

This pull request updates the README.md file and project URLs for the gaussdb-python repository to reflect the latest project status, improve clarity, and ensure consistency across documentation. It also incorporates recent changes to enhance database compatibility and streamline the release process.

Changes Made

  • Updated README.md with clearer installation instructions, updated project URLs, and added references to isort-gaussdb.
  • Modified project URLs in documentation to point to the latest repository and PyPI pages.
  • Added table cleanup in test_array.py to ensure a clean test environment.
  • Removed DBCOMPATIBILITY 'PG' parameter from CREATE DATABASE command in test setup for better compatibility.
  • Enhanced database compatibility handling by adding gaussdb_skip marker and try-except blocks in multiple test files (test_pool_common.py, test_exec.py, test_pgresult.py, test_adapt.py, test_column.py, test_cursor_common.py, test_cursor_common_async.py, test_prepared.py, test_prepared_async.py, test_composite.py, test_datetime.py, test_hstore.py, test_range.py).
  • Updated release workflow to include PyPI upload step and relaxed tag pattern for flexibility.
  • Bumped package versions: gaussdb to 1.0.1, gaussdb_pool to 1.0.1, isort_gaussdb to 0.0.3.
  • Updated bump_version.py to support isort-gaussdb and removed gaussdb_c references.
  • Improved changelog formatting for isort-gaussdb and added it to the documentation index.
  • Removed GPG signing from the version bump script for simplicity.

Why

These changes ensure the gaussdb-python project documentation is up-to-date, improve test reliability across different database environments, and streamline the release process for easier PyPI publishing. The version bumps and changelog updates reflect the latest development milestones, while compatibility enhancements address issues with GaussDB-specific test cases.

Testing

  • Ran unit tests locally using pytest to verify compatibility changes in test files.
  • Validated PyPI upload process using a test token and confirmed successful package publication.
  • Tested README.md rendering on GitHub to ensure formatting and links are correct.
  • Executed bump_version.py with -l patch -a update commit tag to confirm version bumping and tagging.
  • Verified updated URLs resolve to the correct repository and PyPI pages.

Additional Notes

  • The PyPI API token has been added to GitHub Secrets as PYPI_API_TOKEN for automated releases.
  • Ensure the repository has the correct permissions for GitHub Actions to push tags and publish to PyPI.
  • The relaxed tag pattern in the release workflow allows for more flexible versioning in future releases.

Release Commands

To publish the updated packages to PyPI:

  1. Run the version bump script:
    python tools/bump_version.py -l patch -a update commit tag
  2. Push code and tags to the remote repository:
    git push origin master --tags

…n tests.yml to ensure database compatibility with default Mode A.
Comment on lines +58 to +59
except Exception as e:
pytest.skip(f"Database compatibility check failed: {e}")
Copy link

Choose a reason for hiding this comment

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

这是在 O 模式测试不通过的用例吗? 打印的异常信息是不是明确下在 PG 模式可以通过, 在 O 模式无法通过?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

是的,在O模式下是报错的,PG模式是可以通过的,在数据库中也验证过,如下:test02是O模式,test01是PG模式:
两个数据库在空值,datetime等类型有不通的处理:
test=> \c test02
Password for user root:
SSL connection (cipher: ECDHE-RSA-AES128-GCM-SHA256, bits: 128)
You are now connected to database "test02" as user "root".
test02=> create table testmany (a bigint, b bigint);
CREATE TABLE
test02=> insert into testmany values (1, '');
INSERT 0 1

test02=> \c test01
Password for user root:
SSL connection (cipher: ECDHE-RSA-AES128-GCM-SHA256, bits: 128)
You are now connected to database "test01" as user "root".
test01=> create table testmany (a bigint, b bigint);
CREATE TABLE
test01=> insert into testmany values (1, '');
ERROR: The input syntax of type bigint: "" is invalid.
LINE 1: insert into testmany values (1, '');
^
CONTEXT: referenced column: b

Copy link
Collaborator Author

@pangpang20 pangpang20 Jul 1, 2025

Choose a reason for hiding this comment

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

是的,在O模式下是报错的,PG模式是可以通过的,在数据库中也验证过,如下:test02是O模式,test01是PG模式:
两个数据库在空值,datetime等类型有不同的处理:
test=> \c test02
Password for user root:
SSL connection (cipher: ECDHE-RSA-AES128-GCM-SHA256, bits: 128)
You are now connected to database "test02" as user "root".
test02=> create table testmany (a bigint, b bigint);
CREATE TABLE
test02=> insert into testmany values (1, '');
INSERT 0 1

test02=> \c test01
Password for user root:
SSL connection (cipher: ECDHE-RSA-AES128-GCM-SHA256, bits: 128)
You are now connected to database "test01" as user "root".
test01=> create table testmany (a bigint, b bigint);
CREATE TABLE
test01=> insert into testmany values (1, '');
ERROR: The input syntax of type bigint: "" is invalid.
LINE 1: insert into testmany values (1, '');
^
CONTEXT: referenced column: b

Copy link

Choose a reason for hiding this comment

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

OK

@liubao68 liubao68 merged commit 84d5244 into HuaweiCloudDeveloper:master Jul 1, 2025
3 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