File tree Expand file tree Collapse file tree 2 files changed +0
-66
lines changed Expand file tree Collapse file tree 2 files changed +0
-66
lines changed Original file line number Diff line number Diff line change @@ -223,38 +223,6 @@ def close(self) -> Grid:
223
223
224
224
return self .call ("close" )
225
225
226
- def defs (self , filter : str | None = None , limit : int | None = None ) -> Grid :
227
- """Queries [def dicts](https://project-haystack.org/doc/docHaystack/Defs) from
228
- the current
229
- [namespace](https://project-haystack.org/doc/docHaystack/Namespaces).
230
-
231
- Parameters:
232
- filter:
233
- An optional Project Haystack defined
234
- [filter](https://project-haystack.org/doc/docHaystack/Filters) for
235
- querying the server. If a filter is not specified, all defs are
236
- requested from the server.
237
- limit:
238
- An optional integer that specifies the maximum number of defs to return
239
- in the response.
240
-
241
- Returns:
242
- A `Grid` with a `dict` representation of each `def`.
243
- """
244
- data_row = {}
245
-
246
- if filter is not None :
247
- data_row ["filter" ] = filter
248
- if limit is not None :
249
- data_row ["limit" ] = limit
250
-
251
- if len (data_row ) > 0 :
252
- response = self .call ("defs" , Grid .to_grid (data_row ))
253
- else :
254
- response = self .call ("defs" )
255
-
256
- return response
257
-
258
226
def read (self , filter : str , checked : bool = True ) -> Grid :
259
227
"""Read from the database the first record which matches the
260
228
[filter](https://project-haystack.org/doc/docHaystack/Filters).
Original file line number Diff line number Diff line change @@ -115,40 +115,6 @@ def test_about_op(client: Client):
115
115
assert client .about ()["vendorName" ] == "SkyFoundry"
116
116
117
117
118
- def test_defs_with_no_opts (client : Client ):
119
- data_rows = client .defs ().rows
120
-
121
- assert len (data_rows ) > 0
122
- assert "def" in data_rows [0 ].keys ()
123
-
124
-
125
- def test_defs_with_limit (client : Client ):
126
- data_rows = client .defs (limit = 1 ).rows
127
-
128
- assert len (data_rows ) == 1
129
- assert "def" in data_rows [0 ].keys ()
130
-
131
-
132
- def test_defs_with_filter (client : Client ):
133
- data_rows = client .defs ("func" ).rows
134
-
135
- assert len (data_rows ) > 5
136
- assert "def" in data_rows [0 ].keys ()
137
-
138
-
139
- def test_defs_with_limit_and_filter (client : Client ):
140
- data_rows = client .defs ("func" , 1 ).rows
141
-
142
- assert len (data_rows ) == 1
143
- assert "def" in data_rows [0 ].keys ()
144
-
145
-
146
- def test_defs_with_empty_grid_response (client : Client ):
147
- data_rows = client .defs ("point" ).rows
148
-
149
- assert len (data_rows ) == 0
150
-
151
-
152
118
def test_read_site (client : Client ):
153
119
grid = client .read ('site and dis=="Carytown"' )
154
120
assert grid .rows [0 ]["geoState" ] == "VA"
You can’t perform that action at this time.
0 commit comments