Skip to content

Add describe_system_view to table client - #868

Merged
vgvoleg merged 4 commits into
mainfrom
describe-system-view
Jul 30, 2026
Merged

Add describe_system_view to table client#868
vgvoleg merged 4 commits into
mainfrom
describe-system-view

Conversation

@vgvoleg

@vgvoleg vgvoleg commented Jul 29, 2026

Copy link
Copy Markdown
Member

Closes #744.

Adds TableClient.describe_system_view (sync and async) — a stateless TableService.DescribeSystemView RPC that returns a full description of a system view through a new SystemViewSchemeEntry (system view id, name, columns, primary key, attributes). The DescribeTable* messages are deprecated for system views, so this provides the dedicated description.

The proto is already present in the vendored stubs. The RPC carries no session id, so it goes directly through the driver like bulk_upsert (no session pool).

Verified end-to-end against a trunk YDB (every /local/.sys/* view describes correctly, missing paths raise SchemeError); unit tests plus sync and async integration tests added.

Implement TableClient.describe_system_view (sync and async), a stateless
TableService RPC that returns a new SystemViewSchemeEntry with the system
view id, name, columns, primary key and attributes.
@codecov

codecov Bot commented Jul 29, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 82.33%. Comparing base (9143705) to head (5499658).

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #868      +/-   ##
==========================================
+ Coverage   82.28%   82.33%   +0.05%     
==========================================
  Files          99       99              
  Lines       12724    12749      +25     
  Branches     1242     1242              
==========================================
+ Hits        10470    10497      +27     
+ Misses       1800     1798       -2     
  Partials      454      454              
Flag Coverage Δ
integration 80.21% <96.00%> (+0.04%) ⬆️
unit 48.37% <92.00%> (+0.26%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
ydb/_apis.py 100.00% <100.00%> (ø)
ydb/_session_impl.py 61.11% <100.00%> (+1.17%) ⬆️
ydb/aio/table.py 80.32% <100.00%> (+0.10%) ⬆️
ydb/table.py 66.69% <100.00%> (+0.38%) ⬆️

... and 1 file with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Adds first-class support for describing YDB system views via the dedicated TableService.DescribeSystemView RPC, exposing it as a new TableClient.describe_system_view API (sync and async) that returns a new SystemViewSchemeEntry.

Changes:

  • Add describe_system_view to the sync/async table clients and wire it to the stateless DescribeSystemView RPC (no session pool).
  • Introduce SystemViewSchemeEntry and response/request wrapping in _session_impl.
  • Add unit + integration tests (sync + async) and a CHANGELOG entry.

Reviewed changes

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

Show a summary per file
File Description
ydb/table.py Adds describe_system_view and introduces SystemViewSchemeEntry used to represent system view schema.
ydb/table_test.py Adds unit tests for request factory and response wrapper behavior (success + error).
ydb/aio/table.py Adds async describe_system_view wrapper for the aio table client.
ydb/_session_impl.py Implements request factory and response wrapper for DescribeSystemView.
ydb/_apis.py Registers DescribeSystemView method name constant for the table service.
tests/table/test_table_client.py Adds sync integration test covering success and SchemeError on missing view.
tests/aio/test_table_client.py Adds async integration test covering success and SchemeError on missing view.
CHANGELOG.md Documents the new public API addition.

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

Comment thread ydb/table.py Outdated
Comment thread ydb/table.py
Store SystemViewSchemeEntry.attributes as the protobuf map like
TableSchemeEntry (consistency), and document describe_system_view /
SystemViewSchemeEntry in docs/table.rst and docs/apireference.rst.
@vgvoleg

vgvoleg commented Jul 29, 2026

Copy link
Copy Markdown
Member Author

Addressed both review comments in a2d20e4:

  • SystemViewSchemeEntry.attributes now stores the raw protobuf map, consistent with TableSchemeEntry.
  • Documented describe_system_view / SystemViewSchemeEntry in docs/table.rst (sync + async examples) and docs/apireference.rst.

vgvoleg added 2 commits July 29, 2026 10:37
The sync client's async_describe_system_view was the one patch line left
uncovered; exercise it with a fake driver.
@vgvoleg
vgvoleg merged commit fff6572 into main Jul 30, 2026
31 checks passed
@vgvoleg
vgvoleg deleted the describe-system-view branch July 30, 2026 09:14
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.

feature: Add new method describe_system_view

3 participants