Skip to content

Commit

Permalink
Merge branch 'main' into Issue3549
Browse files Browse the repository at this point in the history
  • Loading branch information
jtruit authored Dec 17, 2024
2 parents 9cb3c6b + 31e711b commit e193684
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 5 deletions.
4 changes: 3 additions & 1 deletion .readthedocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@ build:
- asdf plugin add uv
- asdf install uv latest
- asdf global uv latest
- uv sync --only-group docs --frozen
- uv sync --group docs --frozen
- uv run cci task doc --write
- uv run cci flow doc > docs/flows.rst
- uv run -m sphinx -T -b html -d docs/_build/doctrees -D language=en docs $READTHEDOCS_OUTPUT/html

# Build documentation in the docs/ directory with Sphinx
Expand Down
2 changes: 1 addition & 1 deletion cumulusci/tasks/bulkdata/select_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@ def similarity_post_process(
]:
"""Processes the query results for the similarity selection strategy"""
# Handle case where query returns 0 records
if not query_records and not threshold:
if not query_records and threshold is None:
error_message = f"No records found for {sobject} in the target org."
return [], [], error_message

Expand Down
27 changes: 27 additions & 0 deletions cumulusci/tasks/bulkdata/tests/test_select_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -403,6 +403,33 @@ def test_similarity_post_process_with_no_records():
assert error_message == f"No records found for {sobject} in the target org."


def test_similarity_post_process_with_no_records__zero_threshold():
select_operator = SelectOperationExecutor(SelectStrategy.SIMILARITY)
load_records = [["Aditya", "Salesforce"], ["Jawad", "Salesforce"]]
query_records = []
num_records = 2
sobject = "Lead"
(
selected_records,
insert_records,
error_message,
) = select_operator.select_post_process(
load_records=load_records,
query_records=query_records,
num_records=num_records,
sobject=sobject,
weights=[1, 1, 1],
fields=["LastName", "Company"],
threshold=0,
)

# Assert that it inserts everything
assert selected_records == [None, None]
assert insert_records[0] == ["Aditya", "Salesforce"]
assert insert_records[1] == ["Jawad", "Salesforce"]
assert error_message is None


def test_calculate_levenshtein_distance_basic():
record1 = ["hello", "world"]
record2 = ["hullo", "word"]
Expand Down
6 changes: 4 additions & 2 deletions cumulusci/tasks/vlocity/vlocity.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
LWC_RSS_NAME = "OmniStudioLightning"
OMNI_NAMESPACE = "omnistudio"
VBT_SF_ALIAS = "cci-vbt-target"
SF_TOKEN_ENV = "SFDX_ACCESS_TOKEN"
SF_TOKEN_ENV = "SF_ACCESS_TOKEN"
VBT_TOKEN_ENV = "OMNIOUT_TOKEN"


Expand Down Expand Up @@ -106,7 +106,9 @@ def _add_token_to_sfdx(self, access_token: str, instance_url: str) -> str:
# TODO: Use the sf v2 form of this command instead (when we migrate)
token_store_cmd = [
"sf",
"org login access-token",
"org",
"login",
"access-token",
"--no-prompt",
"--alias",
f"{VBT_SF_ALIAS}",
Expand Down
2 changes: 1 addition & 1 deletion docs/reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ maxdepth: 1
---
cheat-sheet
tasks
cumulusci_tasks
flows
env_var_reference
```

0 comments on commit e193684

Please sign in to comment.