Shopify / shopify_python_api

ShopifyAPI library allows Python developers to programmatically access the admin section of stores
http://shopify.github.io/shopify_python_api
MIT License
1.23k stars 349 forks source link

`calculated_refund` Appears as `None` when Printed but is Not Actually `None` #715

Closed nh916 closed 1 month ago

nh916 commented 3 months ago

Description

I'm encountering an issue with the Shopify Python SDK where the calculated_refund object appears to be None when printed, but it is not actually None. This behavior is confusing and makes debugging difficult.

Steps to Reproduce:

  1. Calculate a refund using the Shopify Python SDK.
  2. Print the calculated_refund object.
  3. Check if calculated_refund is None.

Example Code:

calculated_refund = shopify.Refund.calculate(order_id=order_id, refund_line_items=refund_line_items, shipping=refund_shipping)
print(calculated_refund)  # Outputs: None
print(calculated_refund == None)  # Outputs: False

Expected Behavior:

The calculated_refund object should not appear as None when printed if it is not actually None. The __str__ or __repr__ methods should provide a meaningful representation of the object.

Actual Behavior:

The calculated_refund object prints as None, causing confusion during debugging, but calculated_refund == None evaluates to False.

Environment:

Additional Context: It seems that the class definition for calculated_refund might have custom implementations for __str__ or __repr__ methods that return None. This should be addressed to improve the debugging experience.

Request: Please update the __str__ or __repr__ methods for the calculated_refund class to provide a meaningful representation, avoiding the confusion of it appearing as None when it is not.

Thank you!

github-actions[bot] commented 1 month ago

This issue is stale because it has been open for 60 days with no activity. It will be closed if no further action occurs in 14 days.

github-actions[bot] commented 1 month ago

We are closing this issue because it has been inactive for a few months. This probably means that it is not reproducible or it has been fixed in a newer version. If it’s an enhancement and hasn’t been taken on since it was submitted, then it seems other issues have taken priority.

If you still encounter this issue with the latest stable version, please reopen using the issue template. You can also contribute directly by submitting a pull request– see the CONTRIBUTING.md file for guidelines

Thank you!