diff --git a/src/bsdd/bsdd.py b/src/bsdd/bsdd.py index fbc14cc393..3607537304 100644 --- a/src/bsdd/bsdd.py +++ b/src/bsdd/bsdd.py @@ -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, diff --git a/src/bsdd/tests/test_bsdd.py b/src/bsdd/tests/test_bsdd.py index 7bf2d6d2d0..21fd19cfcf 100644 --- a/src/bsdd/tests/test_bsdd.py +++ b/src/bsdd/tests/test_bsdd.py @@ -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"]