File tree Expand file tree Collapse file tree 1 file changed +13
-2
lines changed
Expand file tree Collapse file tree 1 file changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -51,8 +51,13 @@ def __init__(
5151 "loader" : loader_name ,
5252 "source_path" : self .source_path ,
5353 "source_type" : self .source_type ,
54- "source_path_size" : self .source_path_size ,
54+ ** (
55+ {"source_path_size" : self .source_path_size }
56+ if self .source_path_size is not None
57+ else {}
58+ ),
5559 }
60+
5661 # generate app
5762 self .app = self ._get_app_details ()
5863 self ._send_discover ()
@@ -109,7 +114,11 @@ def _send_loader_doc(self, loading_end=False):
109114 "source_path" : doc_source_path ,
110115 "last_modified" : doc .get ("metadata" , {}).get ("last_modified" ),
111116 "file_owner" : doc_source_owner ,
112- "source_path_size" : doc_source_size ,
117+ ** (
118+ {"source_path_size" : doc_source_size }
119+ if doc_source_size is not None
120+ else {}
121+ ),
113122 }
114123 )
115124 payload = {
@@ -226,6 +235,8 @@ def get_file_owner_from_path(file_path: str) -> str:
226235 return file_owner_name
227236
228237 def get_source_size (self , source_path : str ) -> int :
238+ if not source_path :
239+ return None
229240 size = None
230241 if os .path .isfile (source_path ):
231242 size = os .path .getsize (source_path )
You can’t perform that action at this time.
0 commit comments