widgetti / widgetti/solara

Resolve warnings in CI

Open
#360 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
2.2k
Forks
202
Avg merge
4h 36m
Merged PRs (30d)
3

Description

Each of the CI runs have hundreds of warnings. Here are the ones presented in the pytest warnings summary, so probably some of the most important ones. These warnings should be resolved before they turn into errors.

Integration tests

  • tests/integration/api_test.py::test_api_markdown_editor[flask-chromium]
      /opt/hostedtoolcache/Python/3.8.18/x64/lib/python3.8/site-packages/traitlets/__init__.py:26: DeprecationWarning: 
                  Sentinel is not a public part of the traitlets API.
                  It was published by mistake, and may be removed in the future.
                  
        warn(
    
  • tests/integration/api_test.py::test_api_markdown_editor[flask-chromium]
      /opt/hostedtoolcache/Python/3.8.18/x64/lib/python3.8/site-packages/traittypes/traittypes.py:188: DeprecationWarning: metadata {'dtype': None} was set from the constructor. With traitlets 4.1, metadata should be set using the .tag() method, e.g., Int().tag(key1='value1', key2='value2')
        super(DataFrame, self).__init__(
    
  • tests/integration/file_download_test.py: 20 warnings
      /opt/hostedtoolcache/Python/3.8.18/x64/lib/python3.8/site-packages/solara/hooks/use_thread.py:128: DeprecationWarning: use_side_effect is deprecated, please use use_effect
        solara.use_side_effect(run, dependencies + [counter])
    
  • tests/integration/server_test.py: 20 warnings
      /home/runner/work/solara/solara/tests/integration/server_test.py:71: DeprecationWarning:
      
      use_side_effect is deprecated, please use use_effect
    
  • tests/integration/file_download_test.py: 20 warnings
      /opt/hostedtoolcache/Python/3.8.18/x64/lib/python3.8/site-packages/solara/hooks/use_thread.py:128: DeprecationWarning:
      
      use_side_effect is deprecated, please use use_effectl
    
Unit tests
All Python versions
  • ../../../../../opt/hostedtoolcache/Python/3.6.15/x64/lib/python3.6/site-packages/bqplot/marks.py:167
    
      /opt/hostedtoolcache/Python/3.6.15/x64/lib/python3.6/site-packages/bqplot/marks.py:167: DeprecationWarning:
    
    
      metadata {'value_trait': <traitlets.traitlets.Instance object at 0x7fcb84[61](https://github.com/widgetti/solara/actions/runs/6698250420/job/18199885568#step:6:62)0c18>} was set from the constructor. With traitlets 4.1, metadata should be set using the .tag() method, e.g., Int().tag(key1='value1', key2='value2')
    
  • ../../../../../opt/hostedtoolcache/Python/3.6.15/x[64](https://github.com/widgetti/solara/actions/runs/6698250420/job/18199885568#step:6:65)/lib/python3.6/site-packages/bqplot/plotting_widgets.py:30
      /opt/hostedtoolcache/Python/3.6.15/x64/lib/python3.6/site-packages/bqplot/plotting_widgets.py:30: DeprecationWarning:
    
    
      metadata {'dtype': None} was set from the constructor. With traitlets 4.1, metadata should be set using the .tag() method, e.g., Int().tag(key1='value1', key2='value2')
    
  • tests/unit/cache_test.py::test_cache_redis
      /opt/hostedtoolcache/Python/3.6.15/x64/lib/python3.6/site-packages/redis/utils.py:13: CryptographyDeprecationWarning:
    
    
      Python 3.6 is no longer supported by the Python core team. Therefore, support for it is deprecated in cryptography. The next release of cryptography will remove support for Python 3.6.
    
  •   /opt/hostedtoolcache/Python/3.6.15/x64/lib/python3.6/site-packages/solara/hooks/use_thread.py:128: DeprecationWarning:
    
    
      use_side_effect is deprecated, please use use_effect
    
  • tests/unit/dataframe_test.py::test_table
      /opt/hostedtoolcache/Python/3.6.15/x64/lib/python3.6/site-packages/solara/components/dataframe.py:[79](https://github.com/widgetti/solara/actions/runs/6698250420/job/18199885568#step:6:80): DeprecationWarning:
    
    
      use_side_effect is deprecated, please use use_effect
    
  • tests/unit/hooks_test.py::test_hook_iterator
      /opt/hostedtoolcache/Python/3.6.15/x64/lib/python3.6/contextlib.py:99: DeprecationWarning:
    
    
      generator 'cancel_guard' raised StopIteration
    
  • tests/unit/kernel_test.py::test_session_datetime
      /opt/hostedtoolcache/Python/3.6.15/x64/lib/python3.6/json/encoder.py:199: DeprecationWarning:
    
    
      Interpreting naive datetime as local 2023-10-30 20:22:51.449402. Please add timezone info to timestamps.
    
Python 3.9+ specific

Warnings that appear in Python 3.9 CI run, but not in the 3.6 one

  • tests/unit/pivottable_test.py: 81 warnings
      /opt/hostedtoolcache/Python/3.9.18/x64/lib/python3.9/ast.py:407: DeprecationWarning:
      
      visit_NameConstant is deprecated; add visit_Constant
    
  • tests/unit/dataframe_test.py: 4 warnings
      /opt/hostedtoolcache/Python/3.9.18/x64/lib/python3.9/site-packages/vaex/cpu.py:527: DeprecationWarning:
      
      np.find_common_type is deprecated.  Please use `np.result_type` or `np.promote_types`.
      See https://numpy.org/devdocs/release/1.25.0-notes.html and the docs for more information.  (Deprecated NumPy 1.25)
    
  • tests/unit/pivottable_test.py: 7 warnings
      /opt/hostedtoolcache/Python/3.9.18/x64/lib/python3.9/ast.py:407: DeprecationWarning:
      
      visit_Num is deprecated; add visit_Constant
    
  • tests/unit/pivottable_test.py: 59 warnings
      /opt/hostedtoolcache/Python/3.9.18/x64/lib/python3.9/ast.py:407: DeprecationWarning:
      
      visit_Str is deprecated; add visit_Constant
    
  • tests/unit/toestand_test.py::test_thread_local
      /opt/hostedtoolcache/Python/3.9.18/x64/lib/python3.9/site-packages/_pytest/threadexception.py:73: PytestUnhandledThreadExceptionWarning:
      
      Exception in thread Thread-102
      
      Traceback (most recent call last):
        File "/opt/hostedtoolcache/Python/3.9.18/x64/lib/python3.9/threading.py", line 980, in _bootstrap_inner
          self.run()
        File "/opt/hostedtoolcache/Python/3.9.18/x64/lib/python3.9/site-packages/solara/server/patch.py", line 257, in Thread_debug_run
          Thread__run(self)
        File "/opt/hostedtoolcache/Python/3.9.18/x64/lib/python3.9/threading.py", line 917, in run
          self._target(*self._args, **self._kwargs)
        File "/home/runner/work/solara/solara/tests/unit/toestand_test.py", line 777, in test3
          assert solara.lab.thread_local.reactive_used is None
        File "/opt/hostedtoolcache/Python/3.9.18/x64/lib/python3.9/site-packages/solara/lab/__init__.py", line 30, in __getattr__
          raise AttributeError(f"module '{__name__}' has no attribute '{name}'")
      AttributeError: module 'solara.lab' has no attribute 'thread_local'
    
ipywidgets 8.x specific

Warnings that appear in ipywidgets 8.x CI run, but not in the 7.7. one

  • ../../../../../opt/hostedtoolcache/Python/3.9.18/x64/lib/python3.9/site-packages/vaex/dataset_mmap.py:101: 130 warnings
      /opt/hostedtoolcache/Python/3.9.18/x64/lib/python3.9/site-packages/vaex/dataset_mmap.py:101: DeprecationWarning: `product` is deprecated as of NumPy 1.25.0, and will be removed in NumPy 2.0. Please use `prod` instead.
        return self._do_map(path, offset, shape, dtype)
    

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by rerunning the integration and unittest CI workflows linked in the issue, then group the warnings by the listed tests and source paths. Inspect the affected Solara tests and package warnings to determine which are actionable; done means the listed warnings are resolved or otherwise no longer appear in CI.

Written by the indexing model from the issue text.

Assessment

Tech stack
numpy, python
Domain
ci-cd, testing
Issue type
Refactor
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.