question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Submissions: TypeError: '>=' not supported between instances of 'NoneType' and 'int'

See original GitHub issue

I made a submission to the titanic competition using the API: kaggle competitions submissions titanic but when I try to look at my submissions I get the following error:

Traceback (most recent call last):
  File "/Users/brentonmallen/miniconda3/envs/titanic/bin/kaggle", line 11, in <module>
    sys.exit(main())
  File "/Users/brentonmallen/miniconda3/envs/titanic/lib/python3.6/site-packages/kaggle/cli.py", line 50, in main
    out = args.func(**command_args)
  File "/Users/brentonmallen/miniconda3/envs/titanic/lib/python3.6/site-packages/kaggle/api/kaggle_api_extended.py", line 536, in competition_submissions_cli
    submissions = self.competition_submissions(competition)
  File "/Users/brentonmallen/miniconda3/envs/titanic/lib/python3.6/site-packages/kaggle/api/kaggle_api_extended.py", line 509, in competition_submissions
    return [Submission(s) for s in submissions_result]
  File "/Users/brentonmallen/miniconda3/envs/titanic/lib/python3.6/site-packages/kaggle/api/kaggle_api_extended.py", line 509, in <listcomp>
    return [Submission(s) for s in submissions_result]
  File "/Users/brentonmallen/miniconda3/envs/titanic/lib/python3.6/site-packages/kaggle/models/kaggle_models_extended.py", line 44, in __init__
    self.size = File.get_size(self.totalBytes)
  File "/Users/brentonmallen/miniconda3/envs/titanic/lib/python3.6/site-packages/kaggle/models/kaggle_models_extended.py", line 94, in get_size
    while size >= 1024 and suffix_index < 4:
TypeError: '>=' not supported between instances of 'NoneType' and 'int'

I’m using the attached Conda environment:

name: titanic
dependencies:
- pandas=0.23.4
- python=3.6
- pip:
    - zappa==0.46.2
    - flask==1.0.2
    - scikit-learn==0.20
    - cython==0.28.5
    - notebook==5.5.0
    - matplotlib==3.0.0
    - kaggle

Any idea what might be causing this? I wasn’t able to find similar issues.

Thanks

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:8

github_iconTop GitHub Comments

2reactions
ghostcommented, Oct 15, 2018

For these I want to default to the full stack trace I think, since it would be harder to track down with just the error message.

0reactions
0xb0bcommented, May 14, 2020

@rysteboe this bug is still present and can be reproduced. There is #239 opened for another case where this bug shows up. Reproduction:

  • make a submission in a code competition
  • execute the command to get the submissions list while the submission is in the pending state (code is still executing) the result is TypeError:
(python/fastai)> kaggle competitions submissions abstraction-and-reasoning-challenge
Traceback (most recent call last):
  File "/home/xbob/.env/python/fastai/bin/kaggle", line 11, in <module>
    load_entry_point('kaggle==1.5.6', 'console_scripts', 'kaggle')()
  File "/home/xbob/.env/python/fastai/lib/python3.8/site-packages/kaggle/cli.py", line 51, in main
    out = args.func(**command_args)
  File "/home/xbob/.env/python/fastai/lib/python3.8/site-packages/kaggle/api/kaggle_api_extended.py", line 592, in competition_submissions_cli
    submissions = self.competition_submissions(competition)
  File "/home/xbob/.env/python/fastai/lib/python3.8/site-packages/kaggle/api/kaggle_api_extended.py", line 565, in competition_submissions
    return [Submission(s) for s in submissions_result]
  File "/home/xbob/.env/python/fastai/lib/python3.8/site-packages/kaggle/api/kaggle_api_extended.py", line 565, in <listcomp>
    return [Submission(s) for s in submissions_result]
  File "/home/xbob/.env/python/fastai/lib/python3.8/site-packages/kaggle/models/kaggle_models_extended.py", line 45, in __init__
    self.size = File.get_size(self.totalBytes)
  File "/home/xbob/.env/python/fastai/lib/python3.8/site-packages/kaggle/models/kaggle_models_extended.py", line 107, in get_size
    while size >= 1024 and suffix_index < 4:
TypeError: '>=' not supported between instances of 'NoneType' and 'int'

The pull request #240 fixes this issue. With that correction the command works correctly:

(python/fastai)> kaggle competitions submissions abstraction-and-reasoning-challenge
fileName          date                 description                     status    publicScore  privateScore  
----------------  -------------------  ------------------------------  --------  -----------  ------------  
kernel4de6a37211  2020-05-14 12:32:55  From Kernel [kernel4de6a37211]  pending   None         None          
kernel4de6a37211  2020-05-14 12:03:52  From Kernel [kernel4de6a37211]  complete  1.000        None          
kernel4de6a37211  2020-05-13 21:11:16  From Kernel [kernel4de6a37211]  complete  1.000        None  

There is another pull request #245 for the same bug. However, the solution in #240 is preferable as it is global. #245 addresses only the submissions case.

Read more comments on GitHub >

github_iconTop Results From Across the Web

TypeError: '<' not supported between instances of 'NoneType ...
In Python 3 such comparisons raise a TypeError : ... TypeError: '>' not supported between instances of 'NoneType' and 'int' >>> None <...
Read more >
not supported between instances of 'NoneType' and 'int'
The Python "TypeError: '<' not supported between instances of 'NoneType' and 'int'" occurs when we use a comparison operator between a None ...
Read more >
'>' not supported between instances of 'NoneType' and 'int'
1. print() function returns None, so if initial guess is incorrect, in the body of while loop you assign None to num.
Read more >
Error:'<=' not supported between instances of 'NoneType' and 'int
I'm trying to make a function that will: 1. Write a function will_order_dessert that takes in two parameters: kind (as a string), ...
Read more >
TypeError: '>' not supported between instances of 'NoneType ...
I am trying to disable button when Click untill to finish a process then enable again like the below process: user press button...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found