File tree Expand file tree Collapse file tree 2 files changed +16
-1
lines changed
Expand file tree Collapse file tree 2 files changed +16
-1
lines changed Original file line number Diff line number Diff line change @@ -10,6 +10,9 @@ Write the date in place of the "Unreleased" in the case a new version is release
1010
1111- Raise an error with a suitable message when trying to create an API key
1212 on a server that does not support it.
13+ - Backwards compatibility with older servers that do not support the ` properties `
14+ field in ` DataSource ` objects. The client will now omit this field when
15+ communicating with servers older than v0.2.4.
1316
1417## v0.2.6 (2026-02-24)
1518
Original file line number Diff line number Diff line change 1313import entrypoints
1414import httpx
1515import orjson
16+ from packaging .version import Version
1617
1718from ..iterviews import ItemsView , KeysView , ValuesView
1819from ..queries import KeyLookup
@@ -699,13 +700,24 @@ def new(
699700 metadata = metadata or {}
700701 access_blob = {"tags" : access_tags } if access_tags is not None else {}
701702
703+ # Backompatibility: if the server is older than 0.2.4,
704+ # it can not accept the "properties" field in the data source.
705+ # This can be removed in later releases.
706+ if Version (self .context .server_info .library_version ) < Version ("0.2.4" ):
707+ data_sources_as_dicts = [
708+ {k : v for k , v in asdict (ds ).items () if k != "properties" }
709+ for ds in data_sources
710+ ]
711+ else :
712+ data_sources_as_dicts = [asdict (ds ) for ds in data_sources ]
713+
702714 item = {
703715 "attributes" : {
704716 "ancestors" : self .path_parts ,
705717 "metadata" : metadata ,
706718 "structure_family" : StructureFamily (structure_family ),
707719 "specs" : normalize_specs (specs or []),
708- "data_sources" : [ asdict ( data_source ) for data_source in data_sources ] ,
720+ "data_sources" : data_sources_as_dicts ,
709721 "access_blob" : access_blob ,
710722 }
711723 }
You can’t perform that action at this time.
0 commit comments