[source-mixpanel] Export: case-colliding property names get "_" prefix in schema but not in records, values silently dropped
Connector Name
source-mixpanel
Connector Version
4.0.1
What step the error happened?
During the sync
Relevant information
Summary
In the export stream, property names that differ only by case (e.g. gclid and GCLID) are renamed differently in the discovered schema and in the records. As a result, the values of one of the two properties never match any catalog field and are silently dropped by the destination. No error or warning is raised.
Root cause
PropertiesTransformation (source_mixpanel/components.py) calls transform_property_names(), which resolves case-insensitive collisions by prefixing the later name (in sorted order) with _. It is applied in two places with different inputs:
- Schema:
export_schema_loader.schema_transformations(manifest.yaml) runs it on the full list of project properties fromevents/properties/top.GCLIDandgclidcollide, so the catalog getsGCLIDand_gclid. - Records:
export_transformationsruns it on the keys of a single record. An event that only carriesgclidhas no collision within that record, so it is emitted asgclid.
gclid matches neither GCLID nor _gclid, so the destination drops it. The _gclid column exists but is always empty. The underscore column only gets filled when both variants appear in the same event.
When this happens
This is common whenever two senders write to the same Mixpanel project. For example, the Mixpanel JS SDK sends gclid / fbclid / msclkid on page views, while a server-side integration sends GCLID / FBCLID / MSCLKID on backend events. From the moment the second variant shows up in events/properties/top, the first one stops being synced.
Steps to reproduce
- In one Mixpanel project, send event A with property
fooand event B with propertyFOO. Never send both on the same event. - Discover the schema: the catalog contains
FOOand_foo. - Sync
export: event B lands inFOO, but event A'sfoovalue is lost and_foois always null.
Observed impact (our project)
On $mp_web_page_view events, the SDK's gclid, fbclid, gbraid, gad_campaignid, msclkid and twclid have been dropped for months. Their _-prefixed catalog columns are 100% null. _referrer, where both variants occur in the same event, is populated, which confirms the mechanism.
Suggested fix
Make the record transformation use the same mapping as the schema. For example, compute the source_name -> transformed_name mapping once from the full property list (the same events/properties/top call the schema loader already makes), cache it for the sync, and apply it per record. Keys that are not in the mapping keep today's behaviour. This keeps the existing _-prefixed column names, so there is no schema change for existing connections. The currently empty _* columns simply start being populated.
Another approach would be to decide collisions against the configured catalog instead of the record's own keys.
Relevant log output
No error is logged: the values are dropped silently.Contribute
- Yes, I want to contribute
Source: airbytehq/airbyte