column-issue-fixed (#3138)

* column-issue-fixed

* column-type-lookup-optimized
This commit is contained in:
codingwithabhi 2022-03-04 17:01:10 +05:30 committed by GitHub
parent 24ef2af50a
commit 40d3f5e239
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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