bsdd: warn about include_class_properties deprecation

See https://github.com/buildingSMART/bSDD/issues/149
This commit is contained in:
Andrej730
2026-07-15 13:15:01 +05:00
parent a7a7edfd27
commit f4526d152f
2 changed files with 12 additions and 0 deletions
+11
View File
@@ -21,6 +21,7 @@ import http.server
import time
import urllib.parse
import uuid
import warnings
import webbrowser
from typing import TYPE_CHECKING, Any, Literal, Optional, TypedDict
@@ -769,6 +770,16 @@ class Client:
Get Class details
this API replaces Classification
"""
# Not very well documented on bsdd side,
# the deprecation note only occurs when you run into rate limit.
# See https://github.com/buildingSMART/bSDD/issues/149
if include_class_properties:
warnings.warn(
"include_class_properties=True is deprecated and heavily rate-limited by the bSDD API. "
"Use get_class_properties() instead.",
DeprecationWarning,
stacklevel=2,
)
endpoint = f"Class/v{version}"
params = {
"Uri": class_uri,
+1
View File
@@ -31,6 +31,7 @@ def test_get_nbs_classes():
def test_get_class():
uri_light_fixture = next(l for l in get_ifc_classes()["classes"] if "IfcLightFixture" == l["code"])["uri"]
# TODO: fix deprecation warning.
ifc4x3_light_fixture = client.get_class(uri_light_fixture)
assert "Maintenance Factor" and "Light Fixture Mounting Type" in [
l["name"] for l in ifc4x3_light_fixture["classProperties"]