wonderful-iron-54019
05/18/2020, 7:33 PMException message: Both address specs and filesystem specs given. Please use only one type of spec.
wonderful-iron-54019
05/18/2020, 7:33 PMwonderful-iron-54019
05/18/2020, 7:34 PMException message: Both address specs and filesystem specs given. Please use only one type of spec.
Address specs: src/subscription_new/BUILD:BUILD
Filesystem specs: 3rdparty/python/requirements.txt, Pipfile, Pipfile.lock, deploy.sh, pants-docker.ini, src/common/dataframe/test/validate_test.py, src/common/dataframe/validate.py, src/conviva_v2/BUILD, src/conviva_v2/config.yml, src/conviva_v2/conviva_daily_backfill_dag.py, src/conviva_v2/conviva_daily_ingestion.py, src/conviva_v2/helpers.py, src/gdpr_requests/dag.py, src/sfmc_import/BUILD, src/sfmc_import/db_migrations/7a4efabb1dda_20200513_add_sendlog_fields.py, src/sfmc_import/schemas/sendlog.py, src/subscription/check_data.py, src/subscription/dynamo_point_in_time.py, src/subscription/sublime_transform.py, src/subscription/subscription_ingest.py, src/subscription/subscription_state_backfill_dag.py, src/subscription/tests/config_test.py, src/subscription/tests/dynamo_test.py, src/subscription/tests/subscription_ingest_test.py, src/subscription/tests/test_check_data.py, src/subscription/tests/test_sublime_tranform.py, src/subscription/tests/test_utils_funcs.py, src/subscription/tests/utils_for_tests.py, src/subscription/utils.py, src/subscription_new/README.md, src/subscription_new/__init__.py, src/subscription_new/config/__init__.py, src/subscription_new/config/config.py, src/subscription_new/config/config.yml, src/subscription_new/dynamo.py, src/subscription_new/dynamo_to_json.py, src/subscription_new/dynamo_to_parquet.py, src/subscription_new/fixtures/reprocess_hive_data.json, src/subscription_new/fixtures/reprocess_hive_data_expected.json, src/subscription_new/fixtures/unittest_state_engine.json, src/subscription_new/job_config_prod.yml, src/subscription_new/job_config_test.yml, src/subscription_new/schema/__init__.py, src/subscription_new/schema/dynamo_subscription_schema.py, src/subscription_new/schema/state_schema.py, src/subscription_new/scripts/migrate_dynamo_est.py, src/subscription_new/scripts/migrate_dynamo_v2.py, src/subscription_new/scripts/seed_start_date.py, src/subscription_new/scripts/subscription_load_table.sql, src/subscription_new/squirlconf/common.yaml, src/subscription_new/squirlconf/int.yaml, src/subscription_new/squirlconf/prod.yaml, src/subscription_new/squirlconf/qa.yaml, src/subscription_new/sublime_transform.py, src/subscription_new/subscription_backfill_dag.py, src/subscription_new/subscription_dag.py, src/subscription_new/subscription_data_check.py, src/subscription_new/subscription_transform.py, src/subscription_new/tests/__init__.py, src/subscription_new/tests/test_check_data.py, src/subscription_new/tests/test_config.py, src/subscription_new/tests/test_dynamo.py, src/subscription_new/tests/test_sublime_tranform.py, src/subscription_new/tests/test_subscription_transform.py, src/subscription_new/tests/test_utils.py, src/subscription_new/tests/utils.py, src/subscription_new/utils.py, src/watch/data_reconciliation/BUILD
wonderful-iron-54019
05/18/2020, 7:35 PMbuild:build
addresshundreds-father-404
05/18/2020, 7:40 PMsrc/subscriptions
that was getting interpreted as an address spec, because this is shorthand for src/subscriptions:subscriptions
.
But it doesn’t look like that’s what is happening here.hundreds-father-404
05/18/2020, 7:41 PMwonderful-iron-54019
05/18/2020, 7:41 PMsrc/sfmc_import/BUILD
as src/sfmc_import/BUILD:BUILD
?wonderful-iron-54019
05/18/2020, 7:41 PMhundreds-father-404
05/18/2020, 7:41 PM./pants repl
to testwonderful-iron-54019
05/18/2020, 7:41 PMhundreds-father-404
05/18/2020, 7:44 PM▶ ./v2 repl --shell=ipython src/python/pants/base/cmd_line_spec_parser.py
In [1]: from pants.base.cmd_line_spec_parser import CmdLineSpecParser
In [2]: from pants.base.build_environment import get_buildroot
In [3]: spec_parser = CmdLineSpecParser(get_buildroot())
In [4]: spec_parser.parse_spec("src/sfmc_import/BUILD")
Out[4]: SingleAddress(directory='src/sfmc_import/BUILD', name='BUILD')
wonderful-iron-54019
05/18/2020, 7:46 PMwonderful-iron-54019
05/18/2020, 7:47 PMhundreds-father-404
05/18/2020, 7:50 PMif PurePath(spec).suffix
won’t apply, but I would expect the next heuristic of if Path(self._root_dir, spec_path).is_file():
to apply.
Could you please try running this from your build root:
$ python # open a repl
from pathlib import Path
(Path.cwd() / "src/sfmc_import/BUILD").is_file()
wonderful-iron-54019
05/18/2020, 7:51 PMwonderful-iron-54019
05/18/2020, 7:51 PMwonderful-iron-54019
05/18/2020, 7:52 PMwonderful-iron-54019
05/18/2020, 7:52 PMgit diff <version>
that probably detected changed files that didn't. exist on my filesystemwonderful-iron-54019
05/18/2020, 7:52 PMwonderful-iron-54019
05/18/2020, 7:53 PMhundreds-father-404
05/18/2020, 7:53 PMwonderful-iron-54019
05/18/2020, 7:53 PMwonderful-iron-54019
05/18/2020, 7:53 PMgit diff
hundreds-father-404
05/18/2020, 7:54 PMPath.exists()
on it because of deletion.hundreds-father-404
05/18/2020, 7:55 PMBUILD
, but that isn’t great because:
1) I believe you could have a directory with that name
2) If you were to delete Pipfile
, for example, it wouldn’t work properly.hundreds-father-404
05/18/2020, 7:56 PMfolder/
expanding to folder:folder
. That’s been proposed but not explored fully because it has huge implications - for example, that shorthand is really useful in BUILD files for the dependencies
field.wonderful-iron-54019
05/18/2020, 8:02 PMwonderful-iron-54019
05/18/2020, 8:03 PMhundreds-father-404
05/18/2020, 8:06 PMwonderful-iron-54019
05/18/2020, 8:06 PMhundreds-father-404
05/18/2020, 8:08 PM!
, would help. You’re giving Pants a machine generated value, and it would be very clunky to get Git to prepend a special symbolwonderful-iron-54019
05/18/2020, 8:10 PMwonderful-iron-54019
05/18/2020, 8:11 PMhundreds-father-404
05/18/2020, 8:15 PM@goal_rule
like test
will ask for Targets
. There are two paths for the rule graph to fulfill that:
1) FilesystemSpecs -> OwnersOf -> Targets
2) AddressSpecs -> Targets
If both were provided at the same time, then we would have two ways to get the Targets
needed by the goal, and Pants wouldn’t know what to do.
(We could possibly rework things to work around, this, though.)
--
But even if we allowed address and file specs at the same time, you would still hit a similar issue. Pants would still interpret src/sfmc_import/BUILD
as src/sfmc_import/BUILD:BUILD
, and then it would complain that it can’t find any folder called src/sfmc_import/BUILD
with the target :BUILD
hundreds-father-404
05/18/2020, 8:16 PMhundreds-father-404
05/18/2020, 8:16 PM./pants --changed-since
. Pants knows what to do with deleted files if you use that approach.hundreds-father-404
05/18/2020, 8:16 PMwonderful-iron-54019
05/18/2020, 8:18 PM