Skip to content

Commit

Permalink
Fix lint
Browse files Browse the repository at this point in the history
Signed-off-by: popcorny <[email protected]>
  • Loading branch information
popcornylu committed Apr 1, 2024
1 parent 8ce5a23 commit cd2c334
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 8 deletions.
2 changes: 1 addition & 1 deletion recce/dbt.py
Original file line number Diff line number Diff line change
Expand Up @@ -545,7 +545,7 @@ def export_state(self) -> RecceState:
else:
target_path = self.runtime_config.target_path
target_base_path = 'target-base'

def _load_artifact(path):
if not os.path.isfile(path):
return None
Expand Down
4 changes: 2 additions & 2 deletions recce/git.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
def current_branch():
try:
repo = Repo(search_parent_directories=True)
except:
except Exception:
return None

if not repo.active_branch:
return None

return repo.active_branch.name
8 changes: 3 additions & 5 deletions tests/models/test_state.py
Original file line number Diff line number Diff line change
@@ -1,16 +1,14 @@
import json

from recce.models import RunType, Run, Check
from recce.state import RecceState, pydantic_model_json_dump
from recce.state import RecceState


def test_load():
run = Run(type=RunType.QUERY, params=dict(sql_template='select * from users'))
check = Check(name='check 1', description='desc 1', type=run.type, params=run.params)

state = RecceState(runs=[run], checks=[check])
json_data = pydantic_model_json_dump(state)
new_state = RecceState(**json.loads(json_data))
json_content = state.to_json()
new_state = RecceState.from_json(json_content)

run_loaded = new_state.runs[0]
check_loaded = new_state.checks[0]
Expand Down

0 comments on commit cd2c334

Please sign in to comment.