Working on the open source version of my dbt plugi...
# plugins
a
Working on the open source version of my dbt plugin, I have a very simple tailoring rule but am getting the following error when I run it
Copy code
20:30:57.32 [ERROR] 1 Exception encountered:

Engine traceback:
  in root
    ..
  in pants.core.goals.tailor.tailor
    `tailor` goal

Traceback (no traceback):
  <pants native internals>
Exception: Failed to create directory /home/nickd/Projects/data-pants/sample-project/dbt_project.yml: File exists (os error 17)
This is using pants 2.20.1. Here's the source code for the rule
Copy code
@rule
async def find_unowned_dbt_projects(
	request: PutativeDbtProjectsRequest, owned_sources: AllOwnedSources, subsystem: DbtSubsystem
) -> PutativeTargets:
	if not subsystem.tailor_project_targets:
		return PutativeTargets()
	all_dbt_project_paths = await Get(Paths, PathGlobs, request.path_globs("dbt_project.yml"))
	return PutativeTargets(
		PutativeTarget(
			path, "project", DbtProjectTargetGenerator.alias, triggering_sources=[path], owned_sources=[path]
		)
		for path in all_dbt_project_paths.files if path not in owned_sources
	)
Feel like I'm missing something obvious...
b
I have feeling that one of the
path
values needs to be the directory containing the
BUILD
file the target should be added to, not the file path. I'm not sure which one. Searching the pants source for either the definition of
PutativeTarget
or uses of it might provide insight
a
Oh yeah I'm fried that's definitely it
Too much time in the sun today 😅
😁 1
a
oh you're working on a DBT plugin... Keen.
a
@ambitious-actor-36781 It's not ready yet but super rough draft is viewable here https://github.com/ndellosa95/data-pants/tree/wip
👌 1
👀 1