[ https://issues.apache.org/jira/browse/AMBARI-26070?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
William Horn updated AMBARI-26070: ---------------------------------- Description: The Python project introduced new SyntaxWarnings in Python 3.8 to warn users against using 'is' and 'is not' keywords when comparing string literals, as this is an identity comparison when an equality comparison ('==' and '!=') is more likely the intended logic. After this update in the Python project, and moving to Python 3.9 in [AMBARI-26000|https://issues.apache.org/jira/browse/AMBARI-26000] (see the change [here|https://github.com/generalmotors/ambari/commit/5f95ec6c60ef17d65b0ef2b059feb1b9c482aaa4#diff-1082505afdedea77cad7c38946ff8c5c6eeab614d300e661710e25b09e9bd981] to imply the target python version is 3.9), these SyntaxWarnings are exposed when running any ambari-server script commands, as well as within ambari-agent logs. The fix is simply replacing the 'is' and 'is not' keywords with their equality equivalents. was: The Python project introduced new SyntaxWarnings in Python 3.8 to warn users against using 'is' and 'is not' keywords when comparing string literals, as this is an identity comparison when an equality comparison ('==' and '!=') is more likely the intended logic. After this update in the Python project, and moving to Python 3.9 in [AMBARI-26000|http://example.com] (see the change [here|https://github.com/generalmotors/ambari/commit/5f95ec6c60ef17d65b0ef2b059feb1b9c482aaa4#diff-1082505afdedea77cad7c38946ff8c5c6eeab614d300e661710e25b09e9bd981] to imply the target python version is 3.9), these SyntaxWarnings are exposed when running any ambari-server script commands, as well as within ambari-agent logs. The fix is simply replacing the 'is' and 'is not' keywords with their equality equivalents. > Ambari throws SyntaxWarnings after moving to Python3 > ---------------------------------------------------- > > Key: AMBARI-26070 > URL: https://issues.apache.org/jira/browse/AMBARI-26070 > Project: Ambari > Issue Type: Bug > Components: ambari-agent, ambari-server > Affects Versions: 3.0.0 > Reporter: William Horn > Priority: Minor > Attachments: after.png, before.png > > Original Estimate: 1h > Time Spent: 0.5h > Remaining Estimate: 0.5h > > The Python project introduced new SyntaxWarnings in Python 3.8 to warn users > against using 'is' and 'is not' keywords when comparing string literals, as > this is an identity comparison when an equality comparison ('==' and '!=') is > more likely the intended logic. > After this update in the Python project, and moving to Python 3.9 in > [AMBARI-26000|https://issues.apache.org/jira/browse/AMBARI-26000] (see the > change > [here|https://github.com/generalmotors/ambari/commit/5f95ec6c60ef17d65b0ef2b059feb1b9c482aaa4#diff-1082505afdedea77cad7c38946ff8c5c6eeab614d300e661710e25b09e9bd981] > to imply the target python version is 3.9), these SyntaxWarnings are exposed > when running any ambari-server script commands, as well as within > ambari-agent logs. > The fix is simply replacing the 'is' and 'is not' keywords with their > equality equivalents. -- This message was sent by Atlassian Jira (v8.20.10#820010) --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@ambari.apache.org For additional commands, e-mail: issues-h...@ambari.apache.org