mirror of
https://github.com/open-metadata/OpenMetadata.git
synced 2025-11-02 11:39:12 +00:00
column-issue-fixed (#3138)
* column-issue-fixed * column-type-lookup-optimized
This commit is contained in:
parent
24ef2af50a
commit
40d3f5e239
@ -92,13 +92,19 @@ class SalesforceSource(Source[OMetaDatabaseAndTable]):
|
||||
return cls(config, metadata_config, ctx)
|
||||
|
||||
def column_type(self, column_type: str):
|
||||
if column_type in ["ID", "PHONE", "CURRENCY"]:
|
||||
type = "INT"
|
||||
elif column_type in ["REFERENCE", "PICKLIST", "TEXTAREA", "ADDRESS", "URL"]:
|
||||
type = "VARCHAR"
|
||||
else:
|
||||
type = column_type
|
||||
return type
|
||||
if column_type in {"ID", "PHONE", "CURRENCY"}:
|
||||
return "INT"
|
||||
if column_type in {
|
||||
"REFERENCE",
|
||||
"PICKLIST",
|
||||
"TEXTAREA",
|
||||
"ADDRESS",
|
||||
"URL",
|
||||
"EMAIL",
|
||||
}:
|
||||
return "VARCHAR"
|
||||
|
||||
return column_type
|
||||
|
||||
def next_record(self) -> Iterable[OMetaDatabaseAndTable]:
|
||||
yield from self.salesforce_client()
|
||||
@ -143,9 +149,10 @@ class SalesforceSource(Source[OMetaDatabaseAndTable]):
|
||||
Column(
|
||||
name=column["name"],
|
||||
description=column["label"],
|
||||
columnDataType=self.column_type(column["type"].upper()),
|
||||
columnConstraint=col_constraint,
|
||||
dataType=self.column_type(column["type"].upper()),
|
||||
constraint=col_constraint,
|
||||
ordinalPosition=row_order,
|
||||
dataLength=column["length"],
|
||||
)
|
||||
)
|
||||
row_order += 1
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user