Closed TheFatBlue closed 1 day ago
The bug caused by the value of args['sort']
has been solved in #17 . However, when I run the test case test_api_general_reverse_sort
in tests/test_features.py
, there's still some problem. The error message is:
> prices = [float(result['price'].replace('$', '')) for result in results]
E ValueError: could not convert string to float: '1,699.99'
It seems that this is related to the logic handling the price. Similarly, there's same problem in check_price
of tests/test_api_walmart.py
. I'll try to fix this later
The bug caused by the value of
args['sort']
has been solved in #17 . However, when I run the test casetest_api_general_reverse_sort
intests/test_features.py
, there's still some problem. The error message is:> prices = [float(result['price'].replace('$', '')) for result in results] E ValueError: could not convert string to float: '1,699.99'
It seems that this is related to the logic handling the price. Similarly, there's same problem in
check_price
oftests/test_api_walmart.py
. I'll try to fix this later
Thanks for your feedback, if you want to fix this problem, you can fix only in your implementation. When we finish all the tests, we can discuss it together and fix this bug based on dev
branch.
The bug caused by the value of
args['sort']
has been solved in #17 . However, when I run the test casetest_api_general_reverse_sort
intests/test_features.py
, there's still some problem. The error message is:> prices = [float(result['price'].replace('$', '')) for result in results] E ValueError: could not convert string to float: '1,699.99'
It seems that this is related to the logic handling the price. Similarly, there's same problem in
check_price
oftests/test_api_walmart.py
. I'll try to fix this laterThanks for your feedback, if you want to fix this problem, you can fix only in your implementation. When we finish all the tests, we can discuss it together and fix this bug based on
dev
branch.
So you can submit a PR first.
The bug of sort_by
has been solved, and the process logic of price in tests/test_feature.py
has been solved in #21 , too. The remaining problem is to fix the logic for check_price
, which will be done when all the test cases are finished. For the further progress, refer to #22 . This issue is closed.
Description: There is an issue in the sorting mechanism within function
scrape
insrc/scraper_mt.py
, specifically with thesort_by
value inargs['sort']
. The value ofsort_by
is not being set to'pr'
as expected whenorder_by_col == 'price'
. This is causing the sorting function to behave incorrectly, impacting the ordering of items in the result list.Steps to Reproduce:
order_by_col
variable to'price'
.args
with theorder_by_col
condition as a parameter.sort_by
within the loop.Expected Behavior: The
sort_by
variable inargs['sort']
should be set to'pr'
whenorder_by_col
is equal to'price'
.Observed Behavior: The
sort_by
value inargs['sort']
does not become'pr'
as expected. Instead, it appears to have an unexpected value, which causes the sorting logic to not work as intended.Impact on Tests: This bug causes the test case
test_api_general_sort
intests/test_features.py
to fail, as it relies on correct sorting behavior.Environment:
Priority: Medium