acoustic-librarian-29560
05/30/2024, 12:34 AM20: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
@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...broad-processor-92400
05/30/2024, 1:08 AMpath 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 insightacoustic-librarian-29560
05/30/2024, 1:09 AMacoustic-librarian-29560
05/30/2024, 1:09 AMambitious-actor-36781
06/11/2024, 10:45 PMacoustic-librarian-29560
06/12/2024, 1:38 PM