From 1b23827799cc6e57608a0ec42b25ed393f999166 Mon Sep 17 00:00:00 2001 From: Arnaud PICHERY Date: Tue, 8 Jul 2025 15:48:00 +0200 Subject: [PATCH 1/2] Fix reading of headers which are in binary format --- python-formats/sas/format.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/python-formats/sas/format.py b/python-formats/sas/format.py index 5f6ae92..b88fd22 100644 --- a/python-formats/sas/format.py +++ b/python-formats/sas/format.py @@ -85,6 +85,7 @@ def __init__(self, stream, schema, config): self.sas_format = sas_format self.hasSchema = schema != None + self.encoding = encoding if sas_format.lower() == 'xport' and not dump_to_file: buffer = io.BytesIO() @@ -144,6 +145,9 @@ def read_schema(self): else: field_name = getattr(field, 'name', 'unknown') field_type = "DOUBLE" if getattr(field, 'ntype', 2) == 1 else "STRING" + + if isinstance(field_name, bytes): + field_name = field_name.decode(self.encoding) schema.append({"name": field_name, "type": field_type}) return schema @@ -151,6 +155,8 @@ def read_schema(self): if hasattr(self.iterator, 'columns'): schema = [] for col_name in self.iterator.columns: + if isinstance(col_name, bytes): + col_name = col_name.decode(self.encoding) schema.append({"name": col_name, "type": "STRING"}) return schema else: From 63e8385e1e446145fd4daf7f33cf4ced52f1de76 Mon Sep 17 00:00:00 2001 From: Arnaud PICHERY Date: Tue, 8 Jul 2025 15:53:09 +0200 Subject: [PATCH 2/2] Updated version --- CHANGELOG.md | 4 ++++ plugin.json | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b70eff7..79cc96f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Changelog +## Version 1.5.1 - Bugfix release - 2025-07-07 + +- Fix detection of schema of .xport files + ## Version 1.5.0 - Bugfix release - 2025-06-11 - Fix .xport format handling diff --git a/plugin.json b/plugin.json index cd16334..878d0cd 100644 --- a/plugin.json +++ b/plugin.json @@ -1,10 +1,10 @@ { "id": "sas-format", - "version": "1.5.0", + "version": "1.5.1", "meta": { "label": "SAS format provided by Pandas", "description": "Format supporting SAS files (.sas7bdat and .xport). This implementation is provided by Pandas and sas7bdat and may be slower than the light one provided with DSS, but supports more options.", - "author": "Dataiku (Thomas Labadie)", + "author": "Dataiku", "icon": "icon-gears", "licenseInfo": "Apache Software License", "url": "https://www.dataiku.com/dss/plugins/info/sas-format.html",