mirror of
https://github.com/open-metadata/OpenMetadata.git
synced 2025-11-30 01:23:08 +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)
|
return cls(config, metadata_config, ctx)
|
||||||
|
|
||||||
def column_type(self, column_type: str):
|
def column_type(self, column_type: str):
|
||||||
if column_type in ["ID", "PHONE", "CURRENCY"]:
|
if column_type in {"ID", "PHONE", "CURRENCY"}:
|
||||||
type = "INT"
|
return "INT"
|
||||||
elif column_type in ["REFERENCE", "PICKLIST", "TEXTAREA", "ADDRESS", "URL"]:
|
if column_type in {
|
||||||
type = "VARCHAR"
|
"REFERENCE",
|
||||||
else:
|
"PICKLIST",
|
||||||
type = column_type
|
"TEXTAREA",
|
||||||
return type
|
"ADDRESS",
|
||||||
|
"URL",
|
||||||
|
"EMAIL",
|
||||||
|
}:
|
||||||
|
return "VARCHAR"
|
||||||
|
|
||||||
|
return column_type
|
||||||
|
|
||||||
def next_record(self) -> Iterable[OMetaDatabaseAndTable]:
|
def next_record(self) -> Iterable[OMetaDatabaseAndTable]:
|
||||||
yield from self.salesforce_client()
|
yield from self.salesforce_client()
|
||||||
@ -143,9 +149,10 @@ class SalesforceSource(Source[OMetaDatabaseAndTable]):
|
|||||||
Column(
|
Column(
|
||||||
name=column["name"],
|
name=column["name"],
|
||||||
description=column["label"],
|
description=column["label"],
|
||||||
columnDataType=self.column_type(column["type"].upper()),
|
dataType=self.column_type(column["type"].upper()),
|
||||||
columnConstraint=col_constraint,
|
constraint=col_constraint,
|
||||||
ordinalPosition=row_order,
|
ordinalPosition=row_order,
|
||||||
|
dataLength=column["length"],
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
row_order += 1
|
row_order += 1
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user