mirror of
https://github.com/open-metadata/OpenMetadata.git
synced 2025-11-01 11:09:14 +00:00
fix: table column description (#23928)
This commit is contained in:
parent
e49d3ee31a
commit
7ea87e7ca2
@ -184,9 +184,11 @@ class SalesforceSource(DatabaseServiceSource):
|
||||
)
|
||||
if filter_by_table(
|
||||
self.config.sourceConfig.config.tableFilterPattern,
|
||||
table_fqn
|
||||
if self.config.sourceConfig.config.useFqnForFiltering
|
||||
else table_name,
|
||||
(
|
||||
table_fqn
|
||||
if self.config.sourceConfig.config.useFqnForFiltering
|
||||
else table_name
|
||||
),
|
||||
):
|
||||
self.status.filter(
|
||||
table_fqn,
|
||||
@ -238,7 +240,7 @@ class SalesforceSource(DatabaseServiceSource):
|
||||
all_column_description = None
|
||||
try:
|
||||
result = self.client.toolingexecute(
|
||||
f"query/?q=SELECT+Description+FROM+FieldDefinition+WHERE+"
|
||||
f"query/?q=SELECT+Description, QualifiedApiName+FROM+FieldDefinition+WHERE+"
|
||||
f"EntityDefinition.QualifiedApiName='{table_name}'"
|
||||
)
|
||||
all_column_description = result["records"]
|
||||
@ -313,7 +315,7 @@ class SalesforceSource(DatabaseServiceSource):
|
||||
for item in all_column_description:
|
||||
try:
|
||||
if item.get("Description") is not None:
|
||||
column_name = item["attributes"]["url"].split(".")[-1]
|
||||
column_name = item["QualifiedApiName"]
|
||||
column_description_mapping.update(
|
||||
{column_name: item["Description"]}
|
||||
)
|
||||
|
||||
@ -215,7 +215,7 @@ SALESFORCE_FIELDS = [
|
||||
("htmlFormatted", False),
|
||||
("idLookup", False),
|
||||
("inlineHelpText", None),
|
||||
("label", "Contact Description"),
|
||||
("label", "Contact Label"),
|
||||
("length", 32000),
|
||||
("mask", None),
|
||||
("maskType", None),
|
||||
@ -453,7 +453,9 @@ class SalesforceUnitTest(TestCase):
|
||||
"metadata.ingestion.source.database.salesforce.metadata.SalesforceSource.get_table_column_description"
|
||||
)
|
||||
def test_table_column(self, get_table_column_description):
|
||||
get_table_column_description.return_value = None
|
||||
get_table_column_description.return_value = [
|
||||
{"QualifiedApiName": "Description", "Description": "Contact Description"}
|
||||
]
|
||||
result = self.salesforce_source.get_columns("TEST_TABLE", SALESFORCE_FIELDS)
|
||||
assert EXPECTED_COLUMN_VALUE == result
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user