Skip to content

Commit

Permalink
feat: [google-cloud-dataplex] add data quality score to DataQualityRe…
Browse files Browse the repository at this point in the history
…sult (#12080)

- [ ] Regenerate this pull request now.

PiperOrigin-RevId: 587100465

Source-Link:
googleapis/googleapis@2aa3b1d

Source-Link:
googleapis/googleapis-gen@86f694f
Copy-Tag:
eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLWRhdGFwbGV4Ly5Pd2xCb3QueWFtbCIsImgiOiI4NmY2OTRmZWM2YjQ4Y2FjZDYyZDUzNGExYTA3M2JjZGEzYjQ2NDRmIn0=

---------

Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
  • Loading branch information
gcf-owl-bot[bot] and gcf-owl-bot[bot] committed Dec 2, 2023
1 parent 5cd98aa commit 777891d
Show file tree
Hide file tree
Showing 4 changed files with 80 additions and 0 deletions.
Expand Up @@ -62,6 +62,7 @@
DataProfileSpec,
)
from google.cloud.dataplex_v1.types.data_quality import (
DataQualityColumnResult,
DataQualityDimension,
DataQualityDimensionResult,
DataQualityResult,
Expand Down Expand Up @@ -214,6 +215,7 @@
"UpdateContentRequest",
"DataProfileResult",
"DataProfileSpec",
"DataQualityColumnResult",
"DataQualityDimension",
"DataQualityDimensionResult",
"DataQualityResult",
Expand Down
Expand Up @@ -40,6 +40,7 @@
)
from .types.data_profile import DataProfileResult, DataProfileSpec
from .types.data_quality import (
DataQualityColumnResult,
DataQualityDimension,
DataQualityDimensionResult,
DataQualityResult,
Expand Down Expand Up @@ -192,6 +193,7 @@
"DataAttributeBinding",
"DataProfileResult",
"DataProfileSpec",
"DataQualityColumnResult",
"DataQualityDimension",
"DataQualityDimensionResult",
"DataQualityResult",
Expand Down
Expand Up @@ -24,6 +24,7 @@
)
from .data_profile import DataProfileResult, DataProfileSpec
from .data_quality import (
DataQualityColumnResult,
DataQualityDimension,
DataQualityDimensionResult,
DataQualityResult,
Expand Down Expand Up @@ -159,6 +160,7 @@
"UpdateContentRequest",
"DataProfileResult",
"DataProfileSpec",
"DataQualityColumnResult",
"DataQualityDimension",
"DataQualityDimensionResult",
"DataQualityResult",
Expand Down
Expand Up @@ -30,6 +30,7 @@
"DataQualityDimensionResult",
"DataQualityDimension",
"DataQualityRule",
"DataQualityColumnResult",
},
)

Expand Down Expand Up @@ -116,15 +117,30 @@ class BigQueryExport(proto.Message):
class DataQualityResult(proto.Message):
r"""The output of a DataQualityScan.
.. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields
Attributes:
passed (bool):
Overall data quality result -- ``true`` if all rules passed.
score (float):
Output only. The overall data quality score.
The score ranges between [0, 100] (up to two decimal
points).
This field is a member of `oneof`_ ``_score``.
dimensions (MutableSequence[google.cloud.dataplex_v1.types.DataQualityDimensionResult]):
A list of results at the dimension level.
A dimension will have a corresponding
``DataQualityDimensionResult`` if and only if there is at
least one rule with the 'dimension' field set to it.
columns (MutableSequence[google.cloud.dataplex_v1.types.DataQualityColumnResult]):
Output only. A list of results at the column level.
A column will have a corresponding
``DataQualityColumnResult`` if and only if there is at least
one rule with the 'column' field set to it.
rules (MutableSequence[google.cloud.dataplex_v1.types.DataQualityRuleResult]):
A list of all the rules in a job, and their
results.
Expand Down Expand Up @@ -198,11 +214,21 @@ class State(proto.Enum):
proto.BOOL,
number=5,
)
score: float = proto.Field(
proto.FLOAT,
number=9,
optional=True,
)
dimensions: MutableSequence["DataQualityDimensionResult"] = proto.RepeatedField(
proto.MESSAGE,
number=2,
message="DataQualityDimensionResult",
)
columns: MutableSequence["DataQualityColumnResult"] = proto.RepeatedField(
proto.MESSAGE,
number=10,
message="DataQualityColumnResult",
)
rules: MutableSequence["DataQualityRuleResult"] = proto.RepeatedField(
proto.MESSAGE,
number=3,
Expand Down Expand Up @@ -299,12 +325,23 @@ class DataQualityDimensionResult(proto.Message):
r"""DataQualityDimensionResult provides a more detailed,
per-dimension view of the results.
.. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields
Attributes:
dimension (google.cloud.dataplex_v1.types.DataQualityDimension):
Output only. The dimension config specified
in the DataQualitySpec, as is.
passed (bool):
Whether the dimension passed or failed.
score (float):
Output only. The dimension-level data quality score for this
data scan job if and only if the 'dimension' field is set.
The score ranges between [0, 100] (up to two decimal
points).
This field is a member of `oneof`_ ``_score``.
"""

dimension: "DataQualityDimension" = proto.Field(
Expand All @@ -316,6 +353,11 @@ class DataQualityDimensionResult(proto.Message):
proto.BOOL,
number=3,
)
score: float = proto.Field(
proto.FLOAT,
number=4,
optional=True,
)


class DataQualityDimension(proto.Message):
Expand Down Expand Up @@ -688,4 +730,36 @@ class TableConditionExpectation(proto.Message):
)


class DataQualityColumnResult(proto.Message):
r"""DataQualityColumnResult provides a more detailed, per-column
view of the results.
.. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields
Attributes:
column (str):
Output only. The column specified in the
DataQualityRule.
score (float):
Output only. The column-level data quality score for this
data scan job if and only if the 'column' field is set.
The score ranges between between [0, 100] (up to two decimal
points).
This field is a member of `oneof`_ ``_score``.
"""

column: str = proto.Field(
proto.STRING,
number=1,
)
score: float = proto.Field(
proto.FLOAT,
number=2,
optional=True,
)


__all__ = tuple(sorted(__protobuf__.manifest))

0 comments on commit 777891d

Please sign in to comment.