Skip to content

fix: avoid type error for Python 3 #214

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Oct 18, 2019
Merged

Conversation

oakbani
Copy link
Contributor

@oakbani oakbani commented Oct 18, 2019

Summary

  • Fixes python 3 type error when flush interval passes as string
  • Checks if self.executor is defined before calling method on it to avoid scenario where start_on_init is False and user tries to check if the processor is running or tries to stop it.

Test plan

Added unit test with flush interval passed as string

Issues

  • OASIS-5525

not validator.is_finite_number(prop):
is_valid = True

if prop is None or not validator.is_finite_number(prop) or prop <= 0:
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The fix part is that not validator.is_finite_number(prop) comes before prop<=0

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.1%) to 97.694% when pulling f04dbda on oakbani/fix-type-error into f57d5bc on master.

5 similar comments
@coveralls
Copy link

Coverage Status

Coverage decreased (-0.1%) to 97.694% when pulling f04dbda on oakbani/fix-type-error into f57d5bc on master.

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.1%) to 97.694% when pulling f04dbda on oakbani/fix-type-error into f57d5bc on master.

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.1%) to 97.694% when pulling f04dbda on oakbani/fix-type-error into f57d5bc on master.

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.1%) to 97.694% when pulling f04dbda on oakbani/fix-type-error into f57d5bc on master.

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.1%) to 97.694% when pulling f04dbda on oakbani/fix-type-error into f57d5bc on master.

Copy link
Contributor

@Mat001 Mat001 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@Mat001
Copy link
Contributor

Mat001 commented Oct 18, 2019

@oakbani I haven't tried testing Python 2. Can you pls check if Py 2 throws that error too. Let me know or Sohail please. thank you.( @msohailhussain )

@msohailhussain
Copy link
Contributor

@oakbani I haven't tried testing Python 2. Can you pls check if Py 2 throws that error too. Let me know or Sohail please. thank you.( @msohailhussain )

No this issue was not in python2

Copy link
Contributor

@aliabbasrizvi aliabbasrizvi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good.

@aliabbasrizvi aliabbasrizvi merged commit aa2eca3 into master Oct 18, 2019
@aliabbasrizvi aliabbasrizvi deleted the oakbani/fix-type-error branch October 18, 2019 17:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants