Types for Google Cloud Dataqna v1alpha API¶
- class google.cloud.dataqna_v1alpha.types.AnnotatedString(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]¶
Bases:
proto.message.Message
Describes string annotation from both semantic and formatting perspectives. Example:
User Query:
top countries by population in Africa
0 4 14 17 28 31 37
Table Data:
“country” - dimension
“population” - metric
“Africa” - value in the “continent” column
text_formatted =
"top countries by population in Africa"
html_formatted =
"top <b>countries</b> by <b>population</b> in <i>Africa</i>"
markups = [ {DIMENSION, 4, 12}, // 'countries' {METRIC, 17, 26}, // 'population' {FILTER, 31, 36} // 'Africa' ]
Note that html formattings for ‘DIMENSION’ and ‘METRIC’ are the same, while semantic markups are different.
- markups¶
Semantic version of the string annotation.
- Type
MutableSequence[google.cloud.dataqna_v1alpha.types.AnnotatedString.SemanticMarkup]
- class SemanticMarkup(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]¶
Bases:
proto.message.Message
Semantic markup denotes a substring (by index and length) with markup information.
- type_¶
The semantic type of the markup substring.
- class SemanticMarkupType(value)[source]¶
Bases:
proto.enums.Enum
Semantic markup types.
- Values:
- MARKUP_TYPE_UNSPECIFIED (0):
No markup type was specified.
- METRIC (1):
Markup for a substring denoting a metric.
- DIMENSION (2):
Markup for a substring denoting a dimension.
- FILTER (3):
Markup for a substring denoting a filter.
- UNUSED (4):
Markup for an unused substring.
- BLOCKED (5):
Markup for a substring containing blocked phrases.
- ROW (6):
Markup for a substring that contains terms for row.
- class google.cloud.dataqna_v1alpha.types.BigQueryJob(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]¶
Bases:
proto.message.Message
BigQuery job information. This can be used to query the BigQuery API and retrieve the current job’s status (using jobs.get).
- class google.cloud.dataqna_v1alpha.types.CreateQuestionRequest(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]¶
Bases:
proto.message.Message
Request to create a question resource.
- parent¶
Required. The name of the project this data source reference belongs to. Example:
projects/foo/locations/bar
- Type
- question¶
Required. The question to create.
- class google.cloud.dataqna_v1alpha.types.DataQuery(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]¶
Bases:
proto.message.Message
Representation of the data query for the backend. This is provided for informational purposes only. Clients should not use it to send it to the backend directly, but rather use the
execute
RPC to trigger the execution. Using theexecute
RPC is needed in order to track the state of a question and report on it correctly to the data administrators.
- class google.cloud.dataqna_v1alpha.types.DebugFlags(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]¶
Bases:
proto.message.Message
Configuriation of debug flags.
- include_human_interpretation¶
Whether to include the original human interpretation strings generated by Analyza.
- Type
- time_override¶
The time in milliseconds from Unix epoch to be used to process the query. This is useful for testing the queries at different time period. If not set or time_override <= 0, then the current time is used.
- Type
- ignore_cache¶
Determines whether cache needs to be ignored. If set to true, cache won’t be queried and updated.
- Type
- include_search_entities_rpc¶
Whether to include the request/response pair from the call to the EntityIndex for SearchEntities.
- Type
- include_list_column_annotations_rpc¶
Whether to include the request/response pair from the call to the Annotations service for ListColumnAnnotations.
- Type
- class google.cloud.dataqna_v1alpha.types.ExecuteQuestionRequest(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]¶
Bases:
proto.message.Message
Request to execute an interpretation.
- name¶
Required. The unique identifier for the question. Example:
projects/foo/locations/bar/questions/1234
- Type
- class google.cloud.dataqna_v1alpha.types.ExecutionInfo(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]¶
Bases:
proto.message.Message
Information about the backend status (such as BigQuery) of the execution.
- job_creation_status¶
Status returned by the backend when the job was created.
- Type
google.rpc.status_pb2.Status
- job_execution_state¶
Status of the job execution.
- create_time¶
Time when the execution was triggered.
- bigquery_job¶
BigQuery job information. Future versions will have different backends. Hence, clients must make sure they can handle it when this field is not populated.
- class JobExecutionState(value)[source]¶
Bases:
proto.enums.Enum
Enum of possible job execution statuses.
- Values:
- JOB_EXECUTION_STATE_UNSPECIFIED (0):
No job execution was specified.
- NOT_EXECUTED (1):
No job execution was requested, yet.
- RUNNING (2):
The job is running.
- SUCCEEDED (3):
The job completed successfully.
- FAILED (4):
The job completed unsuccessfully.
- class google.cloud.dataqna_v1alpha.types.GetQuestionRequest(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]¶
Bases:
proto.message.Message
A request to get a previously created question.
- name¶
Required. The unique identifier for the question. Example:
projects/foo/locations/bar/questions/1234
- Type
- read_mask¶
The list of fields to be retrieved.
- class google.cloud.dataqna_v1alpha.types.GetUserFeedbackRequest(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]¶
Bases:
proto.message.Message
Request to get user feedback.
- class google.cloud.dataqna_v1alpha.types.HumanReadable(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]¶
Bases:
proto.message.Message
Human readable interpretation.
- generated_interpretation¶
Generated query explaining the interpretation.
- original_question¶
Annotations on the original query.
- class google.cloud.dataqna_v1alpha.types.InterpretEntity(value)[source]¶
Bases:
proto.enums.Enum
Query entities of an interpretation.
- Values:
- INTERPRET_ENTITY_UNSPECIFIED (0):
No interpret entity was specified.
- DIMENSION (1):
A dimenstion entity.
- METRIC (2):
A metric entity.
- class google.cloud.dataqna_v1alpha.types.InterpretError(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]¶
Bases:
proto.message.Message
Details on the failure to interpret the question.
- code¶
The code for the error category why the interpretation failed.
- details¶
Details on interpretation failure.
- class InterpretAmbiguityDetails(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]¶
Bases:
proto.message.Message
Details about a query that was too ambiguous. Currently, the message has no fields and its presence signals that there was ambiguity.
- class InterpretErrorCode(value)[source]¶
Bases:
proto.enums.Enum
The interpret error code provides an error category why the interpretation failed.
- Values:
- INTERPRET_ERROR_CODE_UNSPECIFIED (0):
No interpret error code was specified.
- INVALID_QUERY (1):
The query is not valid.
- FAILED_TO_UNDERSTAND (2):
The interpreter failed to understand the question. For example, because it was too ambiguous.
- FAILED_TO_ANSWER (3):
The interpreter could understand the question, but was not able to arrive at an answer. For example, because a requested operation is not supported.
- class InterpretErrorDetails(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]¶
Bases:
proto.message.Message
Details on interpretation failure.
- unsupported_details¶
Populated if parts of the query are unsupported.
- incomplete_query_details¶
Populated if the query is incomplete.
- ambiguity_details¶
Populated if the query was too ambiguous.
- class InterpretIncompleteQueryDetails(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]¶
Bases:
proto.message.Message
Details about an incomplete query.
- entities¶
List of missing interpret entities.
- Type
MutableSequence[google.cloud.dataqna_v1alpha.types.InterpretEntity]
- class InterpretUnsupportedDetails(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]¶
Bases:
proto.message.Message
Details about unsupported parts in a query.
- class google.cloud.dataqna_v1alpha.types.Interpretation(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]¶
Bases:
proto.message.Message
An interpretation of a natural language query.
- confidence¶
The level of confidence that one of the interpretations is correct. This is a value in the range [0, 1] where a value of 0.5 or below is to be considered a low confidence.
- Type
- unused_phrases¶
A list of unused phrases. Clients should display a Did You Mean (DYM) dialog if this is non-empty, even if this is the only interpretation.
- Type
MutableSequence[str]
- human_readable¶
Human readable representation of the query.
- interpretation_structure¶
Information about the interpretation structure that helps to understand and visualize the response.
- data_query¶
Representation of the data query to be sent to the backend.
- execution_info¶
Information about the backend response. This is populated only if execution of an interpretation was requested.
- class google.cloud.dataqna_v1alpha.types.InterpretationStructure(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]¶
Bases:
proto.message.Message
Information about the interpretation structure that helps to understand and visualize the response.
- visualization_types¶
List of possible visualization types to apply for this interpretation. The order has no relevance.
- Type
MutableSequence[google.cloud.dataqna_v1alpha.types.InterpretationStructure.VisualizationType]
- column_info¶
Information about the output columns, that is, the columns that will be returned by the backend.
- Type
MutableSequence[google.cloud.dataqna_v1alpha.types.InterpretationStructure.ColumnInfo]
- class ColumnInfo(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]¶
Bases:
proto.message.Message
Information about a column.
- output_alias¶
The alias of the output column as used by the backend. For example, the field name in the schema provided in the query response in BigQuery.
- Type
- class VisualizationType(value)[source]¶
Bases:
proto.enums.Enum
Enumeration of visualzation types to use for query response data.
- Values:
- VISUALIZATION_TYPE_UNSPECIFIED (0):
No visualization type was specified.
- TABLE (1):
Show a table.
- BAR_CHART (2):
Show a bar chart.
- COLUMN_CHART (3):
Show a column chart.
- TIMELINE (4):
Show a timeline.
- SCATTER_PLOT (5):
Show a scatter plot.
- PIE_CHART (6):
Show a pie chart.
- LINE_CHART (7):
Show a line chart.
- AREA_CHART (8):
Show an area chart.
- COMBO_CHART (9):
Show a combo chart.
- HISTOGRAM (10):
Show a histogram.
- GENERIC_CHART (11):
This denotes queries when the user has not specified the particular type of chart and has mentioned only a generic chart name such as “Chart”, “Plot”, “Graph”, etc. This will differentiate it from specific charting terms such as “Bar chart”, “Pie chart”, etc.
- CHART_NOT_UNDERSTOOD (12):
The user tried to specify a chart type, but the interpreter could not understand the type. The client should display a generic chart and may give a hint to the user that the requested type was not understood.
- class google.cloud.dataqna_v1alpha.types.Question(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]¶
Bases:
proto.message.Message
The question resource represents a natural language query, its settings, understanding generated by the system, and answer retrieval status. A question cannot be modified.
- name¶
Output only. Immutable. The unique identifier for the Question. The ID is server-generated. Example:
projects/foo/locations/bar/questions/123
- Type
- scopes¶
Required. Immutable. Scopes to be used for the question. A scope defines the relevant data set scope. It can be a reference to a specific data source or a collection of data sources. Currently, support is limited to a single BigQuery table. There must be exactly one
scopes
element.Example:
//bigquery.googleapis.com/projects/test-project/datasets/foo/tables/bar
- Type
MutableSequence[str]
- data_source_annotations¶
A list of annotations to use instead of the default annotation of a data source (set in the data source reference resource). There must not be more than one annotation with the same data source reference.
- Type
MutableSequence[str]
- interpret_error¶
An error field explaining why interpretation failed. This is only populated if the interpretation failed.
Note: This is different from getting a status error on the request itself. This is not a client or server error and the Question resource is still persisted, but the service could not interpret the question. Clients should present the error to the user so the user can rephrase the question.
- interpretations¶
A list of interpretations for this question.
- Type
MutableSequence[google.cloud.dataqna_v1alpha.types.Interpretation]
- create_time¶
Time when the question was created.
- debug_flags¶
Input only. Immutable. Flags to request additional information for debugging purposes.
- debug_info¶
Top level debug information. This will be stored as the type DebugInformation. Using Any so clients don’t need to pull in anything inside the debug message.
- class google.cloud.dataqna_v1alpha.types.SuggestQueriesRequest(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]¶
Bases:
proto.message.Message
Request for query suggestions.
- parent¶
Required. The parent of the suggestion query is the resource denoting the project and location.
- Type
- scopes¶
The scopes to which this search is restricted. The only supported scope pattern is
//bigquery.googleapis.com/projects/{GCP-PROJECT-ID}/datasets/{DATASET-ID}/tables/{TABLE-ID}
.- Type
MutableSequence[str]
- query¶
User query for which to generate suggestions. If the query is empty, zero state suggestions are returned. This allows UIs to display suggestions right away, helping the user to get a sense of what a query might look like.
- Type
- suggestion_types¶
The requested suggestion type. Multiple suggestion types can be requested, but there is no guarantee that the service will return suggestions for each type. Suggestions for a requested type might rank lower than suggestions for other types and the service may decide to cut these suggestions off.
- Type
MutableSequence[google.cloud.dataqna_v1alpha.types.SuggestionType]
- class google.cloud.dataqna_v1alpha.types.SuggestQueriesResponse(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]¶
Bases:
proto.message.Message
Response to SuggestQueries.
- suggestions¶
A list of suggestions.
- Type
MutableSequence[google.cloud.dataqna_v1alpha.types.Suggestion]
- class google.cloud.dataqna_v1alpha.types.Suggestion(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]¶
Bases:
proto.message.Message
A suggestion for a query with a ranking score.
- suggestion_info¶
Detailed information about the suggestion.
- ranking_score¶
The score of the suggestion. This can be used to define ordering in UI. The score represents confidence in the suggestion where higher is better. All score values must be in the range [0, 1).
- Type
- suggestion_type¶
The type of the suggestion.
- class google.cloud.dataqna_v1alpha.types.SuggestionInfo(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]¶
Bases:
proto.message.Message
Detailed information about the suggestion.
- annotated_suggestion¶
Annotations for the suggestion. This provides information about which part of the suggestion corresponds to what semantic meaning (e.g. a metric).
- query_matches¶
Matches between user query and the annotated string.
- Type
MutableSequence[google.cloud.dataqna_v1alpha.types.SuggestionInfo.MatchInfo]
- class MatchInfo(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]¶
Bases:
proto.message.Message
MatchInfo describes which part of suggestion matched with data in user typed query. This can be used to highlight matching parts in the UI. This is different from the annotations provided in annotated_suggestion. The annotated_suggestion provides information about the semantic meaning, while this provides information about how it relates to the input.
Example: user query:
top products
annotated_suggestion { text_formatted = "top product_group" html_formatted = "top <b>product_group</b>" markups { {type: TEXT, start_char_index: 0, length: 3} {type: DIMENSION, start_char_index: 4, length: 13} } } query_matches { { start_char_index: 0, length: 3 } { start_char_index: 4, length: 7} }
- class google.cloud.dataqna_v1alpha.types.SuggestionType(value)[source]¶
Bases:
proto.enums.Enum
The type of suggestion.
- Values:
- SUGGESTION_TYPE_UNSPECIFIED (0):
No suggestiont type is specified.
- ENTITY (1):
Entity suggestion type. Suggestions are for single entities.
- TEMPLATE (2):
Template suggestion type. Suggestions are for full sentences.
- class google.cloud.dataqna_v1alpha.types.UpdateUserFeedbackRequest(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]¶
Bases:
proto.message.Message
Request to updates user feedback.
- user_feedback¶
Required. The user feedback to update. This can be called even if there is no user feedback so far. The feedback’s name field is used to identify the user feedback (and the corresponding question) to update.
- update_mask¶
The list of fields to be updated.
- class google.cloud.dataqna_v1alpha.types.UserFeedback(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]¶
Bases:
proto.message.Message
Feedback provided by a user.
- name¶
Required. The unique identifier for the user feedback. User feedback is a singleton resource on a Question. Example:
projects/foo/locations/bar/questions/1234/userFeedback
- Type
- rating¶
The user feedback rating
- class UserFeedbackRating(value)[source]¶
Bases:
proto.enums.Enum
Enumeration of feedback ratings.
- Values:
- USER_FEEDBACK_RATING_UNSPECIFIED (0):
No rating was specified.
- POSITIVE (1):
The user provided positive feedback.
- NEGATIVE (2):
The user provided negative feedback.