feat: AsyncClient / SyncClient feature parity + unified linting#303
Open
feat: AsyncClient / SyncClient feature parity + unified linting#303
Conversation
Design document for adding 13 missing public methods to AsyncDgraphClient to achieve 1:1 parity with the sync client.
Add 14 methods to AsyncDgraphClient and 5 gRPC wrappers to AsyncDgraphClientStub, achieving 1:1 feature parity with DgraphClient. New async client methods: - Alter wrappers: drop_all, drop_data, drop_predicate, drop_type, set_schema - DQL operations: run_dql, run_dql_with_vars - Namespace management: create_namespace, drop_namespace, list_namespaces - ID allocation: allocate_uids, allocate_timestamps, allocate_namespaces (plus private _allocate_ids helper) New async stub methods: - run_dql, allocate_ids, create_namespace, drop_namespace, list_namespaces All methods mirror their sync counterparts exactly in signature, parameters, return types, JWT retry behavior, and error handling. Includes 26 new integration tests (38 total async tests). Closes #TBD
- Change metadata parameter types to tuple[tuple[str, str | bytes], ...] matching grpc-stubs - Replace AuthMetadataPlugin lambdas with proper _AuthPlugin class - Annotate async stub as DgraphAsyncStub for correct await inference - Pass grace=None to async channel.close()
…re with per-module overrides - Enable mypy@1.18.2, pre-commit-hooks@6.0.0, ty-check custom linter in trunk.yaml - Re-enable trunk-fmt-pre-commit and trunk-check-pre-push actions - Remove all # type: ignore directives from non-generated pydgraph code - Add mypy per-module disable_error_code overrides in pyproject.toml - Add ty per-file rule overrides in pyproject.toml [tool.ty.overrides] - Move ty proto file excludes from CLI flags to [tool.ty.src] config - ty-check uses output: regex with success_codes: [0] (strict)
- Remove .pre-commit-config.yaml - Remove pre-commit and shellcheck-py from dev dependencies - Update make check: pre-commit run -> trunk check --all --no-fix - Update make setup: remove pre-commit install step - Update CI code-quality workflow: use trunk check --all --ci directly
…uppress ARG002 with noqa
…of trunk linter - Add examples/** to trunk mypy ignore (examples have untyped code) - Remove ty-check custom linter from trunk (shared org trunk action lacks uv) - Run ty as separate step in code-quality workflow and make check
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.
Summary
Brings AsyncClient to full parity with SyncClient and consolidates all linting under Trunk as the sole orchestrator.
Async Client Feature Parity
AsyncDgraphClientand 5 gRPC wrappers toAsyncDgraphClientStub, achieving 1:1 feature parity with the syncDgraphClientdrop_all,drop_data,drop_predicate,drop_type,set_schema), DQL operations (run_dql,run_dql_with_vars), namespace management (create_namespace,drop_namespace,list_namespaces), and ID allocation (allocate_uids,allocate_timestamps,allocate_namespaces)Unified Linting (Trunk replaces pre-commit)
Consolidates three overlapping linting systems (pre-commit, Trunk, CI
SKIP=...workarounds) into Trunk as the single orchestrator..pre-commit-config.yamlandpre-commit/shellcheck-pydev dependencies# type: ignoredirectives in non-generated code with per-module overrides inpyproject.tomlfor both mypy ([[tool.mypy.overrides]]) and ty ([[tool.ty.overrides]])make checkrunstrunk check --all --no-fix+uv run ty checktrunk check --all --ciplus standalone ty step_AuthPlugin(grpc.AuthMetadataPlugin)class, annotated async stub typesType Safety
Both mypy and ty now pass with zero errors and zero inline suppression comments in library code. Type mismatches between grpc-stubs and runtime behavior are handled via per-module config overrides rather than scattered
# type: ignoredirectives.