Add return_not_null_data_as_optional parameter to read_table - #880
Open
krasnovdm wants to merge 1 commit into
Open
Add return_not_null_data_as_optional parameter to read_table#880krasnovdm wants to merge 1 commit into
krasnovdm wants to merge 1 commit into
Conversation
The gRPC ReadTableRequest already has a return_not_null_data_as_optional field and the C++ SDK exposes it as ReturnNotNullAsOptional, but the Python SDK never set it, so read_table always wrapped NOT NULL columns in Optional with no way to opt out. Plumb the flag through read_table (sync + async) and read_table_request_factory. Default behavior is unchanged (still Optional).
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.
Problem
read_tablealways returnsNOT NULLcolumns wrapped inOptional, and there is no way to opt out in the Python SDK.The gRPC
ReadTableRequestalready has areturn_not_null_data_as_optionalfield, and the C++ SDK exposes it viaTReadTableSettings().ReturnNotNullAsOptional(false). The Python SDK simply never set this field, so users reading a table withNOT NULLcolumns always getOptionalvalues back.Change
Add a
return_not_null_data_as_optionalparameter toread_table(syncydb/table.pyand asyncydb/aio/table.py) and plumb it throughread_table_request_factory. It accepts abool(mapped toFeatureFlag.ENABLED/DISABLED) or a rawFeatureFlag.Status.Default behavior is unchanged: when the parameter is not provided, the field is left unset and
NOT NULLcolumns are still returned asOptional(backward compatible).