Skip to content

Commit

Permalink
revert: logic for failing on having reserved keyword
Browse files Browse the repository at this point in the history
  • Loading branch information
ayush-shah committed Nov 18, 2024
1 parent ddf4af3 commit 6b00e81
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 100 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,6 @@ def revert_separators(value):


def replace_separators(value):
if RESERVED_COLON_KEYWORD in value or RESERVED_ARROW_KEYWORD in value:
raise ValueError("Reserved keywords found in the name")
return value.replace("::", RESERVED_COLON_KEYWORD).replace(
">", RESERVED_ARROW_KEYWORD
)
Expand Down
98 changes: 0 additions & 98 deletions ingestion/tests/unit/models/test_custom_pydantic.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import uuid
from unittest import TestCase

import pytest

from metadata.generated.schema.api.data.createTable import CreateTableRequest
from metadata.generated.schema.entity.data.table import (
Column,
Expand Down Expand Up @@ -143,99 +141,3 @@ def test_revert_separator(self):
)
assert fetch_response_revert_separator.name.root == "test::table"
assert fetch_response_revert_separator_2.name.root == "test::table>"

def test_invalid_table(self):
with pytest.raises(Exception):
create_request_invalid = CreateTableRequest(
name=EntityName("Sales::>__reserved__colon__Territory"),
displayName="SalesTerritory",
description=Markdown(root="Sales territory lookup table."),
tableType="Regular",
columns=[
Column(
name=ColumnName(root="Sales::Last>Year"),
displayName="SalesLastYear",
dataType="NUMBER",
arrayDataType=None,
dataLength=None,
precision=None,
scale=None,
dataTypeDisplay="NUMBER",
description=Markdown(root="Sales total of previous year."),
fullyQualifiedName=None,
tags=None,
constraint="NOT_NULL",
ordinalPosition=7,
jsonSchema=None,
children=None,
profile=None,
customMetrics=None,
),
Column(
name=ColumnName(root="Bonus"),
displayName="Bonus",
dataType="NUMBER",
arrayDataType=None,
dataLength=None,
precision=None,
scale=None,
dataTypeDisplay="NUMBER",
description=Markdown(root="Bonus due if quota is met."),
fullyQualifiedName=None,
tags=None,
constraint="NOT_NULL",
ordinalPosition=4,
jsonSchema=None,
children=None,
profile=None,
customMetrics=None,
),
Column(
name=ColumnName(root="ModifiedDate"),
displayName="ModifiedDate",
dataType="DATETIME",
arrayDataType=None,
dataLength=None,
precision=None,
scale=None,
dataTypeDisplay="DATETIME",
description=Markdown(
root="Date and time the record was last updated."
),
fullyQualifiedName=None,
tags=None,
constraint="NOT_NULL",
ordinalPosition=9,
jsonSchema=None,
children=None,
profile=None,
customMetrics=None,
),
],
dataModel=None,
tableConstraints=[
TableConstraint(
constraintType="PRIMARY_KEY", columns=["Sales::Last>Year"]
)
],
tablePartition=None,
tableProfilerConfig=None,
owners=None,
databaseSchema=FullyQualifiedEntityName(
root='New Gyro 360.New Gyro 360."AdventureWorks2017.HumanResources"'
),
tags=None,
schemaDefinition=None,
retentionPeriod=None,
extension=EntityExtension(
root={
"DataQuality": '<div><p><b>Last evaluation:</b> 07/24/2023<br><b>Interval: </b>30 days <br><b>Next run:</b> 08/23/2023, 10:44:20<br><b>Measurement unit:</b> percent [%]</p><br><table><tbody><tr><th>Metric</th><th>Target</th><th>Latest result</th></tr><tr><td><p class="text-success">Completeness</p></td><td>90%</td><td><div class="bar fabric" style="width: 100%;"><strong>100%</strong></div></td></tr><tr><td><p class="text-success">Integrity</p></td><td>90%</td><td><div class="bar fabric" style="width: 100%;"><strong>100%</strong></div></td></tr><tr><td><p class="text-warning">Timeliness</p></td><td>90%</td><td><div class="bar fabric" style="width: 25%;"><strong>25%</strong></div></td></tr><tr><td><p class="text-warning">Uniqueness</p></td><td>90%</td><td><div class="bar fabric" style="width: 60%;"><strong>60%</strong></div></td></tr><tr><td><p class="text-success">Validity</p></td><td>90%</td><td><div class="bar fabric" style="width: 100%;"><strong>100%</strong></div></td></tr></tbody></table><h3>Overall score of the table is: 77%</h3><hr style="border-width: 5px;"></div>'
}
),
sourceUrl=None,
domain=None,
dataProducts=None,
fileFormat=None,
lifeCycle=None,
sourceHash=None,
)

0 comments on commit 6b00e81

Please sign in to comment.