@@ -2593,25 +2593,6 @@ def _snapshots(
25932593
25942594 return {name : stored_snapshots .get (s .snapshot_id , s ) for name , s in snapshots .items ()}
25952595
2596- def _get_target_environment (self , environment : t .Optional [str ] = None ) -> t .Tuple [str , str ]:
2597- environment = environment or self .config .default_target_environment
2598- environment = Environment .sanitize_name (environment )
2599-
2600- initial_environment = environment
2601-
2602- if self .config .plan .always_compare_against_prod :
2603- prod = self .state_reader .get_environment (c .PROD )
2604- if prod :
2605- logger .warning (
2606- f"Comparing against production environment instead of { environment } . Note that this may lead to "
2607- "additional backfills as accumulated changes are still pushed to the target environment."
2608- )
2609- environment = c .PROD
2610- else :
2611- environment = environment or c .PROD
2612-
2613- return environment .lower (), initial_environment .lower ()
2614-
26152596 def _context_diff (
26162597 self ,
26172598 environment : str ,
@@ -2621,13 +2602,13 @@ def _context_diff(
26212602 ensure_finalized_snapshots : bool = False ,
26222603 diff_rendered : bool = False ,
26232604 ) -> ContextDiff :
2624- target_environment , initial_environment = self . _get_target_environment (environment )
2605+ environment = Environment . sanitize_name (environment )
26252606
26262607 if force_no_diff :
26272608 return ContextDiff .create_no_diff (environment , self .state_reader )
26282609
26292610 return ContextDiff .create (
2630- environment = target_environment ,
2611+ environment = environment ,
26312612 snapshots = snapshots or self .snapshots ,
26322613 create_from = create_from or c .PROD ,
26332614 state_reader = self .state_reader ,
@@ -2638,7 +2619,7 @@ def _context_diff(
26382619 environment_statements = self ._environment_statements ,
26392620 gateway_managed_virtual_layer = self .config .gateway_managed_virtual_layer ,
26402621 infer_python_dependencies = self .config .infer_python_dependencies ,
2641- initial_environment = initial_environment ,
2622+ always_compare_against_prod = self . config . plan . always_compare_against_prod ,
26422623 )
26432624
26442625 def _destroy (self ) -> None :
0 commit comments