Skip to main content
New

Provide FME attribute types via Python

Related products:IntegrationsTransformers
  • August 21, 2025
  • 5 replies
  • 128 views

denniswilhelm
Contributor
Forum|alt.badge.img+18

Hi,

in the record information you can nicely see data types (uint8, buffer, date, time, varchar) for all available attributes when selecting an individual feature: 

 

However, when accessing these information in Python we only get the basic types:

 

Would it be possible to also get the full list of data types in Python?

In my current use case, I’m supposed to convert all date attributes to another format. Since it’s a generic workflow, I don’t know in advance which attributes are containing dates. When looking at the schema feature I can see that the data types have been recognized correctly by FME. There is just no way easy way to get that information for each feature.

Kind regards,

Dennis

5 replies

alexbiz
Influencer
Forum|alt.badge.img+30
  • Influencer
  • August 21, 2025

You could maybe use the SchemaScanner to process its result in your python ?


denniswilhelm
Contributor
Forum|alt.badge.img+18
  • Author
  • Contributor
  • August 21, 2025

You could maybe use the SchemaScanner to process its result in your python ?

I do have a working process that involves the schema feature. But steps like these negatively impact the performance and just seem unecessary. I’m assuming that the the information exists for each feature anyways and just isn’t available via the API.


vlroyrenn
Enthusiast
Forum|alt.badge.img+14
  • Enthusiast
  • September 29, 2025

You could maybe use the SchemaScanner to process its result in your python ?

Doesn’t SchemaScanner disregard the attribute type and basically act as if all columns were text? When your data sources are databases and such, the schema and its types are statically known throughout the workbench, and getAttributeType partly lets you read that, but only the internal storage types, not the actual attribute types (from FME 2023+).

 

See also 

 


denniswilhelm
Contributor
Forum|alt.badge.img+18
  • Author
  • Contributor
  • September 30, 2025

Doesn’t SchemaScanner disregard the attribute type and basically act as if all columns were text? When your data sources are databases and such, the schema and its types are statically known throughout the workbench, and getAttributeType partly lets you read that, but only the internal storage types, not the actual attribute types (from FME 2023+).

No, the SchemaScanner will scan the data types again and provide detailed types. Of course, these could differ from the original source data types.


vlroyrenn
Enthusiast
Forum|alt.badge.img+14
  • Enthusiast
  • September 30, 2025

Doesn’t SchemaScanner disregard the attribute type and basically act as if all columns were text? When your data sources are databases and such, the schema and its types are statically known throughout the workbench, and getAttributeType partly lets you read that, but only the internal storage types, not the actual attribute types (from FME 2023+).

No, the SchemaScanner will scan the data types again and provide detailed types. Of course, these could differ from the original source data types.

I’m doing some tests just to double check, and the results are not to different (though not quite the same) from the “Attribute types from feature cache” feature from AttributeManager, where some types like fme_logical will be converted to fme_varchar(1) or fme_buffer depensing on settings, fme_number is converted into fme_real64 (even those that would fit in a 32 bit float like fme_number(7,5)) and my fme_int32 IDs get narrowed to fme_uint16.

I think there really is some information loss when using SchemaScanner.

You’re not wrong, however, that SchemaScanner does know the current feature schema, because if I look at the doc for SchemaScannerFactory and the contents of FME2023/transformers/fmesuite.fmx or FME2024/transformers.db, SchemaScanner does get a TEMPLATE_SCHEMA { $(XFORMER_SCHEMA) } value passed to it. Unfortunately, the PythonCaller transformer doesn’t get passed anything of the sort (the only transformers who are made aware of it are StatisticsCalculator, Inspector and SchemaScanner), so that information is just not accessible from any Python code.