Skip to content

Commit f171b91

Browse files
vdusekclaude
andcommitted
refactor: Move resource_path default from __init__ param to super().__init__() call
Pass resource_path as a hardcoded string literal directly in the super().__init__() call instead of exposing it as a defaulted parameter in each resource client's __init__ signature. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent e204bed commit f171b91

27 files changed

+54
-136
lines changed

src/apify_client/_resource_clients/actor.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,12 +60,11 @@ def __init__(
6060
self,
6161
*,
6262
resource_id: str,
63-
resource_path: str = 'acts',
6463
**kwargs: Any,
6564
) -> None:
6665
super().__init__(
6766
resource_id=resource_id,
68-
resource_path=resource_path,
67+
resource_path='acts',
6968
**kwargs,
7069
)
7170

@@ -524,12 +523,11 @@ def __init__(
524523
self,
525524
*,
526525
resource_id: str,
527-
resource_path: str = 'acts',
528526
**kwargs: Any,
529527
) -> None:
530528
super().__init__(
531529
resource_id=resource_id,
532-
resource_path=resource_path,
530+
resource_path='acts',
533531
**kwargs,
534532
)
535533

src/apify_client/_resource_clients/actor_collection.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,10 @@ class ActorCollectionClient(ResourceClient):
2222

2323
def __init__(
2424
self,
25-
*,
26-
resource_path: str = 'acts',
2725
**kwargs: Any,
2826
) -> None:
2927
super().__init__(
30-
resource_path=resource_path,
28+
resource_path='acts',
3129
**kwargs,
3230
)
3331

@@ -161,12 +159,10 @@ class ActorCollectionClientAsync(ResourceClientAsync):
161159

162160
def __init__(
163161
self,
164-
*,
165-
resource_path: str = 'acts',
166162
**kwargs: Any,
167163
) -> None:
168164
super().__init__(
169-
resource_path=resource_path,
165+
resource_path='acts',
170166
**kwargs,
171167
)
172168

src/apify_client/_resource_clients/actor_env_var.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,11 @@ def __init__(
3434
self,
3535
*,
3636
resource_id: str,
37-
resource_path: str = 'env-vars',
3837
**kwargs: Any,
3938
) -> None:
4039
super().__init__(
4140
resource_id=resource_id,
42-
resource_path=resource_path,
41+
resource_path='env-vars',
4342
**kwargs,
4443
)
4544

@@ -104,12 +103,11 @@ def __init__(
104103
self,
105104
*,
106105
resource_id: str,
107-
resource_path: str = 'env-vars',
108106
**kwargs: Any,
109107
) -> None:
110108
super().__init__(
111109
resource_id=resource_id,
112-
resource_path=resource_path,
110+
resource_path='env-vars',
113111
**kwargs,
114112
)
115113

src/apify_client/_resource_clients/actor_env_var_collection.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,10 @@ class ActorEnvVarCollectionClient(ResourceClient):
1919

2020
def __init__(
2121
self,
22-
*,
23-
resource_path: str = 'env-vars',
2422
**kwargs: Any,
2523
) -> None:
2624
super().__init__(
27-
resource_path=resource_path,
25+
resource_path='env-vars',
2826
**kwargs,
2927
)
3028

@@ -78,12 +76,10 @@ class ActorEnvVarCollectionClientAsync(ResourceClientAsync):
7876

7977
def __init__(
8078
self,
81-
*,
82-
resource_path: str = 'env-vars',
8379
**kwargs: Any,
8480
) -> None:
8581
super().__init__(
86-
resource_path=resource_path,
82+
resource_path='env-vars',
8783
**kwargs,
8884
)
8985

src/apify_client/_resource_clients/actor_version.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,11 @@ def __init__(
2929
self,
3030
*,
3131
resource_id: str,
32-
resource_path: str = 'versions',
3332
**kwargs: Any,
3433
) -> None:
3534
super().__init__(
3635
resource_id=resource_id,
37-
resource_path=resource_path,
36+
resource_path='versions',
3837
**kwargs,
3938
)
4039

@@ -139,12 +138,11 @@ def __init__(
139138
self,
140139
*,
141140
resource_id: str,
142-
resource_path: str = 'versions',
143141
**kwargs: Any,
144142
) -> None:
145143
super().__init__(
146144
resource_id=resource_id,
147-
resource_path=resource_path,
145+
resource_path='versions',
148146
**kwargs,
149147
)
150148

src/apify_client/_resource_clients/actor_version_collection.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,10 @@ class ActorVersionCollectionClient(ResourceClient):
2525

2626
def __init__(
2727
self,
28-
*,
29-
resource_path: str = 'versions',
3028
**kwargs: Any,
3129
) -> None:
3230
super().__init__(
33-
resource_path=resource_path,
31+
resource_path='versions',
3432
**kwargs,
3533
)
3634

@@ -108,12 +106,10 @@ class ActorVersionCollectionClientAsync(ResourceClientAsync):
108106

109107
def __init__(
110108
self,
111-
*,
112-
resource_path: str = 'versions',
113109
**kwargs: Any,
114110
) -> None:
115111
super().__init__(
116-
resource_path=resource_path,
112+
resource_path='versions',
117113
**kwargs,
118114
)
119115

src/apify_client/_resource_clients/build.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,11 @@ def __init__(
2525
self,
2626
*,
2727
resource_id: str,
28-
resource_path: str = 'actor-builds',
2928
**kwargs: Any,
3029
) -> None:
3130
super().__init__(
3231
resource_id=resource_id,
33-
resource_path=resource_path,
32+
resource_path='actor-builds',
3433
**kwargs,
3534
)
3635

@@ -127,12 +126,11 @@ def __init__(
127126
self,
128127
*,
129128
resource_id: str,
130-
resource_path: str = 'actor-builds',
131129
**kwargs: Any,
132130
) -> None:
133131
super().__init__(
134132
resource_id=resource_id,
135-
resource_path=resource_path,
133+
resource_path='actor-builds',
136134
**kwargs,
137135
)
138136

src/apify_client/_resource_clients/build_collection.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,10 @@ class BuildCollectionClient(ResourceClient):
1717

1818
def __init__(
1919
self,
20-
*,
21-
resource_path: str = 'actor-builds',
2220
**kwargs: Any,
2321
) -> None:
2422
super().__init__(
25-
resource_path=resource_path,
23+
resource_path='actor-builds',
2624
**kwargs,
2725
)
2826

@@ -63,12 +61,10 @@ class BuildCollectionClientAsync(ResourceClientAsync):
6361

6462
def __init__(
6563
self,
66-
*,
67-
resource_path: str = 'actor-builds',
6864
**kwargs: Any,
6965
) -> None:
7066
super().__init__(
71-
resource_path=resource_path,
67+
resource_path='actor-builds',
7268
**kwargs,
7369
)
7470

src/apify_client/_resource_clients/dataset.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -70,12 +70,11 @@ def __init__(
7070
self,
7171
*,
7272
resource_id: str | None = None,
73-
resource_path: str = 'datasets',
7473
**kwargs: Any,
7574
) -> None:
7675
super().__init__(
7776
resource_id=resource_id,
78-
resource_path=resource_path,
77+
resource_path='datasets',
7978
**kwargs,
8079
)
8180

@@ -700,12 +699,11 @@ def __init__(
700699
self,
701700
*,
702701
resource_id: str | None = None,
703-
resource_path: str = 'datasets',
704702
**kwargs: Any,
705703
) -> None:
706704
super().__init__(
707705
resource_id=resource_id,
708-
resource_path=resource_path,
706+
resource_path='datasets',
709707
**kwargs,
710708
)
711709

src/apify_client/_resource_clients/dataset_collection.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,10 @@ class DatasetCollectionClient(ResourceClient):
1818

1919
def __init__(
2020
self,
21-
*,
22-
resource_path: str = 'datasets',
2321
**kwargs: Any,
2422
) -> None:
2523
super().__init__(
26-
resource_path=resource_path,
24+
resource_path='datasets',
2725
**kwargs,
2826
)
2927

@@ -77,12 +75,10 @@ class DatasetCollectionClientAsync(ResourceClientAsync):
7775

7876
def __init__(
7977
self,
80-
*,
81-
resource_path: str = 'datasets',
8278
**kwargs: Any,
8379
) -> None:
8480
super().__init__(
85-
resource_path=resource_path,
81+
resource_path='datasets',
8682
**kwargs,
8783
)
8884

0 commit comments

Comments
 (0)