Skip to content

Commit

Permalink
Added a case to ensure even supplied types get original_type.data_type
Browse files Browse the repository at this point in the history
  • Loading branch information
lancegliser committed Sep 26, 2024
1 parent 46d8bd0 commit 4f682e4
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/features/sources/Base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,15 +39,14 @@ export abstract class InferFeatureAttributesBase {
const columns = await this.getFeatureNames();

const getFeatureAttributes = async (featureName: string): Promise<FeatureAttributes | undefined> => {
if (featureName in attributes && attributes[featureName]?.type) {
return undefined;
}

const originalFeatureType = await this.getOriginalFeatureType(featureName);
const featureAttributes: Omit<FeatureAttributes, "type"> = {
original_type: originalFeatureType,
};

switch (true) {
case !!attributes[featureName]?.type:
return { ...featureAttributes, type: attributes[featureName]?.type };
case featureName in ordinalFeatureValues:
return { ...featureAttributes, type: "ordinal", bounds: { allowed: ordinalFeatureValues[featureName] } };
case originalFeatureType?.data_type === "numeric":
Expand Down

0 comments on commit 4f682e4

Please sign in to comment.