Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compile on-run-(start|end) hooks to file #412

Merged
merged 7 commits into from
May 9, 2017

Conversation

drewbanin
Copy link
Contributor

@drewbanin drewbanin commented May 9, 2017

@cmcarthur i'm not super happy with this yet -- going to try to clean up a little in the AM

@drewbanin drewbanin changed the title Compile on run hooks to file Compile on-run-(start|end) hooks to file May 9, 2017
@drewbanin drewbanin requested a review from cmcarthur May 9, 2017 02:00
Copy link
Member

@cmcarthur cmcarthur left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this looks pretty good. there is a lot of messy conditional logic in runner.py and compilation.py but you don't need to deal with that all here.

there are a few questions in here, wondering why you did a couple specific things in here.

if you fix the circle build, this is ok from my end

for name, node in flat_graph.get('nodes').items():
self.link_node(linker, node, flat_graph)
linked_graph['nodes'][name] = node
for node_type in ['nodes', 'operations']:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

curious why you put operations in a separate subgraph

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah, i think you're right -- these can in the nodes graph... let me investigate

@@ -331,6 +331,52 @@ def load_and_parse_sql(package_name, root_project, all_projects, root_dir,
return parse_sql_nodes(result, root_project, all_projects, tags)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks like this file was chmod +xed -- can you undo that

dbt/parser.py Outdated
'raw_sql': hooks
})

return parse_sql_nodes(result, root_project, all_projects, tags={hook_type})
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks great

if is_model and is_ephemeral:
res.append(ancestor)

return set(res)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

dbt/runner.py Outdated
]

return self.run_types_from_graph(include_spec,
exclude_spec,
resource_types=resource_types,
tags=set(),
should_run_hooks=False,
should_execute=False)
should_execute=False,
flatten_graph=True)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why flatten the graph here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

debugging! good catch

@drewbanin
Copy link
Contributor Author

this fixes #403

Copy link
Member

@cmcarthur cmcarthur left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

one really dumb comment, but this lgtm

dbt/utils.py Outdated
@@ -31,6 +31,12 @@ class NodeType(object):
Operation = 'operation'


class RunHookTypes:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

RunHookType

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reasonable

@drewbanin drewbanin merged commit ce46052 into development May 9, 2017
@drewbanin drewbanin deleted the compile-on-run-hooks-to-file branch May 9, 2017 20:01
iknox-fa pushed a commit that referenced this pull request Feb 8, 2022
compile on-run-(start|end) hooks to a file

automatic commit by git-black, original commits:
  ce46052
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants