Skip to content

Commit 9a5be2d

Browse files
committed
set default value of populate_store on client query methods to True
Objects retrieved by the SDK will be stored by the internal client store by default. The behavior can be changed by setting it explicitly to False. This removes the need to set populate_store to True when you want to prefetch relationships.
1 parent 7c65729 commit 9a5be2d

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

infrahub_sdk/client.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -457,7 +457,7 @@ async def get(
457457
hfid: list[str] | None = None,
458458
include: list[str] | None = None,
459459
exclude: list[str] | None = None,
460-
populate_store: bool = False,
460+
populate_store: bool = True,
461461
fragment: bool = False,
462462
prefetch_relationships: bool = False,
463463
property: bool = False,
@@ -611,7 +611,7 @@ async def all(
611611
at: Timestamp | None = None,
612612
branch: str | None = None,
613613
timeout: int | None = None,
614-
populate_store: bool = False,
614+
populate_store: bool = True,
615615
offset: int | None = None,
616616
limit: int | None = None,
617617
include: list[str] | None = None,
@@ -707,7 +707,7 @@ async def filters(
707707
at: Timestamp | None = None,
708708
branch: str | None = None,
709709
timeout: int | None = None,
710-
populate_store: bool = False,
710+
populate_store: bool = True,
711711
offset: int | None = None,
712712
limit: int | None = None,
713713
include: list[str] | None = None,
@@ -1726,7 +1726,7 @@ def all(
17261726
at: Timestamp | None = None,
17271727
branch: str | None = None,
17281728
timeout: int | None = None,
1729-
populate_store: bool = False,
1729+
populate_store: bool = True,
17301730
offset: int | None = None,
17311731
limit: int | None = None,
17321732
include: list[str] | None = None,
@@ -1857,7 +1857,7 @@ def filters(
18571857
at: Timestamp | None = None,
18581858
branch: str | None = None,
18591859
timeout: int | None = None,
1860-
populate_store: bool = False,
1860+
populate_store: bool = True,
18611861
offset: int | None = None,
18621862
limit: int | None = None,
18631863
include: list[str] | None = None,
@@ -2110,7 +2110,7 @@ def get(
21102110
hfid: list[str] | None = None,
21112111
include: list[str] | None = None,
21122112
exclude: list[str] | None = None,
2113-
populate_store: bool = False,
2113+
populate_store: bool = True,
21142114
fragment: bool = False,
21152115
prefetch_relationships: bool = False,
21162116
property: bool = False,

0 commit comments

Comments
 (0)