Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
4 changes: 2 additions & 2 deletions plugin.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
6 changes: 6 additions & 0 deletions python-formats/sas/format.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -144,13 +145,18 @@ 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
else:
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:
Expand Down
Loading