In Airflow version greater than 3.0.0, please use default instead of default_var
variable = Variable.get('setting_x', default=0)