File tree 2 files changed +8
-4
lines changed
2 files changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -277,11 +277,14 @@ def _is_in_test(self) -> bool:
277
277
def visit_ClassDef (self , node : ast .ClassDef ) -> None :
278
278
self .stack .append (node )
279
279
self ._no_rst (node )
280
+ self ._syntax_error_example (node )
280
281
self ._mlflow_class_name (node )
281
282
self .generic_visit (node )
282
283
self .stack .pop ()
283
284
284
- def _syntax_error_example (self , node : ast .FunctionDef | ast .AsyncFunctionDef ) -> None :
285
+ def _syntax_error_example (
286
+ self , node : ast .FunctionDef | ast .AsyncFunctionDef | ast .ClassDef
287
+ ) -> None :
285
288
if docstring_node := self ._docstring (node ):
286
289
for code_block in _iter_code_blocks (docstring_node .value ):
287
290
try :
Original file line number Diff line number Diff line change @@ -27,10 +27,11 @@ class DBConnectArtifactCache:
27
27
db_artifact_cache = DBConnectArtifactCache.get_or_create()
28
28
db_artifact_cache.add_artifact_archive("archive1", "/tmp/archive1.tar.gz")
29
29
30
+
30
31
@pandas_udf(...)
31
- def my_udf(... ):
32
- # we can get the unpacked archive files in `archive1_unpacked_dir`
33
- archive1_unpacked_dir = db_artifact_cache.get("archive1")
32
+ def my_udf(x ):
33
+ # we can get the unpacked archive files in `archive1_unpacked_dir`
34
+ archive1_unpacked_dir = db_artifact_cache.get("archive1")
34
35
"""
35
36
36
37
_global_cache = None
You can’t perform that action at this time.
0 commit comments