Uploaded image for project: 'Ambari'
  1. Ambari
  2. AMBARI-25854 Ambari With Python3 Support
  3. AMBARI-25900

modify Function Ceil/Floor from python2 to python3

    XMLWordPrintableJSON

Details

    • Sub-task
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 2.7.5
    • None
    • ambari-agent, ambari-server
    • Ambari:Ambari-2.7.5

      OS:        OpenEuler-22.03

      Python: Python 3.9.9

    Description

      In pytthon2, ceil()/floor() function work as follows:

           ceil(1.2) => 2.0

           floor(1.2) => 1.0

      In python3, ceil() function work as follows:

           ceil(1.2) => 2

           floor(1.2) => 1

       

      which means that in python2 it return a float value, in python3 it return a Integer, this feature will casue Unit Test failed. 

       

      To avoid failed unit test, I would like to make this change:

      python2 :  a = ceil(b)

      python3 :  a = float(ceil(b))

       

      Attachments

        Activity

          People

            Unassigned Unassigned
            Charming603473 Charming Wu
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated: