@@ -196,7 +196,9 @@ def run_direct_relational_import(
196196
197197 # Check if the field exists in the DataFrame
198198 if field not in source_df .columns :
199- log .error (f"Field '{ field } ' not found in source DataFrame. Available columns: { source_df .columns } " )
199+ log .error (
200+ f"Field '{ field } ' not found in source DataFrame. Available columns: { source_df .columns } "
201+ )
200202 return None
201203
202204 # 2. Prepare the related model's IDs using the resolver
@@ -269,14 +271,18 @@ def _prepare_link_dataframe(
269271
270272 # Check if the field exists in the DataFrame
271273 if field not in source_df .columns :
272- log .error (f"Field '{ field } ' not found in source DataFrame. Available columns: { source_df .columns } " )
274+ log .error (
275+ f"Field '{ field } ' not found in source DataFrame. Available columns: { source_df .columns } "
276+ )
273277 # Return an empty DataFrame with the expected schema
274- return pl .DataFrame (schema = {
275- "external_id" : pl .Utf8 ,
276- field : pl .Utf8 ,
277- owning_model_fk : pl .Int64 ,
278- f"{ related_model_fk } /id" : pl .Int64
279- })
278+ return pl .DataFrame (
279+ schema = {
280+ "external_id" : pl .Utf8 ,
281+ field : pl .Utf8 ,
282+ owning_model_fk : pl .Int64 ,
283+ f"{ related_model_fk } /id" : pl .Int64 ,
284+ }
285+ )
280286
281287 # Create the link table DataFrame
282288 link_df = source_df .select (["id" , field ]).rename ({"id" : "external_id" })
@@ -343,7 +349,9 @@ def run_write_tuple_import(
343349
344350 # Check if the field exists in the DataFrame
345351 if field not in source_df .columns :
346- log .error (f"Field '{ field } ' not found in source DataFrame. Available columns: { source_df .columns } " )
352+ log .error (
353+ f"Field '{ field } ' not found in source DataFrame. Available columns: { source_df .columns } "
354+ )
347355 return False
348356
349357 # 2. Prepare the related model's IDs using the resolver
0 commit comments