Skip to content

Commit 6e08b44

Browse files
committed
PR Feedback 1
1 parent dc285df commit 6e08b44

2 files changed

Lines changed: 3 additions & 11 deletions

File tree

sqlmesh/core/context.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2614,7 +2614,7 @@ def _context_diff(
26142614
return ContextDiff.create_no_diff(environment, self.state_reader)
26152615

26162616
return ContextDiff.create(
2617-
environment=environment,
2617+
environment=environment or c.PROD,
26182618
snapshots=snapshots or self.snapshots,
26192619
create_from=create_from or c.PROD,
26202620
state_reader=self.state_reader,

sqlmesh/core/context_diff.py

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414

1515
import sys
1616
import typing as t
17-
import logging
1817

1918
from difflib import ndiff, unified_diff
2019
from functools import cached_property
@@ -40,8 +39,6 @@
4039

4140
IGNORED_PACKAGES = {"sqlmesh", "sqlglot"}
4241

43-
logger = logging.getLogger(__name__)
44-
4542

4643
class ContextDiff(PydanticModel):
4744
"""ContextDiff is an object representing the difference between two environments.
@@ -135,7 +132,8 @@ def create(
135132
Returns:
136133
The ContextDiff object.
137134
"""
138-
initial_environment = environment
135+
initial_environment = environment.lower()
136+
139137
environment = _get_target_environment(
140138
environment, state_reader, always_compare_against_prod
141139
)
@@ -507,13 +505,7 @@ def _get_target_environment(
507505
if always_compare_against_prod:
508506
prod = state_reader.get_environment(c.PROD)
509507
if prod:
510-
logger.warning(
511-
f"Comparing against production environment instead of {environment}. Note that this may lead to "
512-
"additional backfills as accumulated changes are still pushed to the target environment."
513-
)
514508
environment = c.PROD
515-
else:
516-
environment = environment or c.PROD
517509

518510
return environment.lower()
519511

0 commit comments

Comments
 (0)