Skip to content
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

Revert "Provide more useful str representations for models" #211

Merged
merged 1 commit into from
Nov 26, 2024

Conversation

yuvipanda
Copy link
Member

Reverts #205

Causes evaluations to fail with:

Traceback (most recent call last):
  File "/opt/frx-challenges/frx_challenges/manage.py", line 22, in <module>
    main()
  File "/opt/frx-challenges/frx_challenges/manage.py", line 18, in main
    execute_from_command_line(sys.argv)
  File "/usr/local/lib/python3.12/site-packages/django/core/management/__init__.py", line 442, in execute_from_command_line
    utility.execute()
  File "/usr/local/lib/python3.12/site-packages/django/core/management/__init__.py", line 436, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/usr/local/lib/python3.12/site-packages/django/core/management/base.py", line 413, in run_from_argv
    self.execute(*args, **cmd_options)
  File "/usr/local/lib/python3.12/site-packages/django/core/management/base.py", line 459, in execute
    output = self.handle(*args, **options)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/frx-challenges/frx_challenges/web/management/commands/evaluator.py", line 219, in handle
    asyncio.run(self.ahandle())
  File "/usr/local/lib/python3.12/asyncio/runners.py", line 194, in run
    return runner.run(main)
           ^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/asyncio/runners.py", line 118, in run
    return self._loop.run_until_complete(task)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/asyncio/base_events.py", line 687, in run_until_complete
    return future.result()
           ^^^^^^^^^^^^^^^
  File "/opt/frx-challenges/frx_challenges/web/management/commands/evaluator.py", line 214, in ahandle
    await self.process_running_evaluation(evaluator, e)
  File "/opt/frx-challenges/frx_challenges/web/management/commands/evaluator.py", line 170, in process_running_evaluation
    logger.info(f"{evaluation} is completed")
                  ^^^^^^^^^^^^
  File "/opt/frx-challenges/frx_challenges/web/models.py", line 151, in __str__
    return f"submission:{self.version.submission.name} version:{self.version.id} id:{self.id} status:{self.status}"
                         ^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/django/db/models/fields/related_descriptors.py", line 257, in __get__
    rel_obj = self.get_object(instance)
              ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/django/db/models/fields/related_descriptors.py", line 220, in get_object
    return qs.get(self.field.get_reverse_related_filter(instance))
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/django/db/models/query.py", line 645, in get
    num = len(clone)
          ^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/django/db/models/query.py", line 382, in __len__
    self._fetch_all()
  File "/usr/local/lib/python3.12/site-packages/django/db/models/query.py", line 1928, in _fetch_all
    self._result_cache = list(self._iterable_class(self))
                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/django/db/models/query.py", line 91, in __iter__
    results = compiler.execute_sql(
              ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/django/db/models/sql/compiler.py", line 1572, in execute_sql
    cursor = self.connection.cursor()
             ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/django/utils/asyncio.py", line 24, in inner
    raise SynchronousOnlyOperation(message)
django.core.exceptions.SynchronousOnlyOperation: You cannot call this from an async context - use a thread or sync_to_async.
Unclosed connector
connections: ['deque([(<aiohttp.client_proto.ResponseHandler object at 0x7f6634aa9af0>, 1616293.848390642)])']
connector: <aiohttp.connector.TCPConnector object at 0x7f6634a60d40>

@yuvipanda yuvipanda merged commit e54ccc8 into main Nov 26, 2024
2 checks passed
@yuvipanda yuvipanda deleted the revert-205-str branch November 26, 2024 08:14
jnywong pushed a commit to 2i2c-org/frx-challenges-helm-chart that referenced this pull request Nov 26, 2024
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.

1 participant