@@ -362,17 +362,19 @@ def get_uniform_sample_pipeline(
362
362
project_pipeline = create_nested_pipeline (response_model )
363
363
project_pipeline ["timestamp" ] = "$timestamp"
364
364
365
- # Handle flat models (like Pressure, LiquidLevel, pH) that have a single main field
366
- if len (response_model .__fields__ ) == 2 and "timestamp" in response_model .__fields__ :
367
- main_field = next (field for field in response_model .__fields__ if field != "timestamp" )
368
- lookup_field = (
369
- response_model .collection_name ()
370
- if hasattr (response_model , "collection_name" )
371
- else response_model .__name__
372
- )
373
- mongo_field = new_collections .get (lookup_field , main_field .lower ())
374
- project_pipeline [main_field ] = f"${ mongo_field } "
375
- logger .debug (f"Mapping { mongo_field } to { main_field } for model { response_model .__name__ } " )
365
+ # # Handle flat models (like Pressure, LiquidLevel, pH) that have a single main field
366
+ # if len(response_model.__fields__) == 2 and "timestamp" in response_model.__fields__:
367
+ # main_field = next(field for field in response_model.__fields__ if field != "timestamp")
368
+ # lookup_field = (
369
+ # response_model.collection_name()
370
+ # if hasattr(response_model, "collection_name")
371
+ # else response_model.__name__
372
+ # )
373
+ # mongo_field = new_collections.get(lookup_field, main_field.lower())
374
+ # project_pipeline[main_field] = f"${mongo_field}"
375
+ # logger.info(f"Mapping {mongo_field} to {main_field} for model {response_model.__name__}")
376
+
377
+ logger .info (f"Project pipeline for { response_model .__name__ } : { project_pipeline } " )
376
378
377
379
pipeline = [
378
380
{"$match" : match_clause },
@@ -394,7 +396,7 @@ def get_uniform_sample_pipeline(
394
396
{"$sort" : {"timestamp" : 1 }},
395
397
]
396
398
397
- logger .debug (f"Pipeline for { response_model .__name__ } : { pipeline } " )
399
+ logger .info (f"Pipeline for { response_model .__name__ } : { pipeline } " )
398
400
return pipeline
399
401
400
402
0 commit comments