@@ -369,19 +369,30 @@ def same_contract(self, old, adapter_type=None) -> bool:
369369 # This would only apply to seeds
370370 return True
371371
372+ def same_vars (self , old ) -> bool :
373+ return self .vars == old .vars
374+
372375 def same_contents (self , old , adapter_type ) -> bool :
373376 if old is None :
374377 return False
375378
376379 # Need to ensure that same_contract is called because it
377380 # could throw an error
378381 same_contract = self .same_contract (old , adapter_type )
382+
383+ # Legacy behaviour
384+ if not get_flags ().state_modified_compare_vars :
385+ same_vars = True
386+ else :
387+ same_vars = self .same_vars (old )
388+
379389 return (
380390 self .same_body (old )
381391 and self .same_config (old )
382392 and self .same_persisted_description (old )
383393 and self .same_fqn (old )
384394 and self .same_database_representation (old )
395+ and same_vars
385396 and same_contract
386397 and True
387398 )
@@ -1251,6 +1262,9 @@ def same_config(self, old: "SourceDefinition") -> bool:
12511262 old .unrendered_config ,
12521263 )
12531264
1265+ def same_vars (self , other : "SourceDefinition" ) -> bool :
1266+ return self .vars == other .vars
1267+
12541268 def same_contents (self , old : Optional ["SourceDefinition" ]) -> bool :
12551269 # existing when it didn't before is a change!
12561270 if old is None :
@@ -1264,13 +1278,20 @@ def same_contents(self, old: Optional["SourceDefinition"]) -> bool:
12641278 # freshness changes are changes, I guess
12651279 # metadata/tags changes are not "changes"
12661280 # patching/description changes are not "changes"
1281+ # Legacy behaviour
1282+ if not get_flags ().state_modified_compare_vars :
1283+ same_vars = True
1284+ else :
1285+ same_vars = self .same_vars (old )
1286+
12671287 return (
12681288 self .same_database_representation (old )
12691289 and self .same_fqn (old )
12701290 and self .same_config (old )
12711291 and self .same_quoting (old )
12721292 and self .same_freshness (old )
12731293 and self .same_external (old )
1294+ and same_vars
12741295 and True
12751296 )
12761297
@@ -1367,12 +1388,21 @@ def same_config(self, old: "Exposure") -> bool:
13671388 old .unrendered_config ,
13681389 )
13691390
1391+ def same_vars (self , old : "Exposure" ) -> bool :
1392+ return self .vars == old .vars
1393+
13701394 def same_contents (self , old : Optional ["Exposure" ]) -> bool :
13711395 # existing when it didn't before is a change!
13721396 # metadata/tags changes are not "changes"
13731397 if old is None :
13741398 return True
13751399
1400+ # Legacy behaviour
1401+ if not get_flags ().state_modified_compare_vars :
1402+ same_vars = True
1403+ else :
1404+ same_vars = self .same_vars (old )
1405+
13761406 return (
13771407 self .same_fqn (old )
13781408 and self .same_exposure_type (old )
@@ -1383,6 +1413,7 @@ def same_contents(self, old: Optional["Exposure"]) -> bool:
13831413 and self .same_label (old )
13841414 and self .same_depends_on (old )
13851415 and self .same_config (old )
1416+ and same_vars
13861417 and True
13871418 )
13881419
@@ -1634,6 +1665,7 @@ class ParsedNodePatch(ParsedPatch):
16341665 latest_version : Optional [NodeVersion ]
16351666 constraints : List [Dict [str , Any ]]
16361667 deprecation_date : Optional [datetime ]
1668+ vars : Dict [str , Any ]
16371669 time_spine : Optional [TimeSpine ] = None
16381670
16391671
0 commit comments