Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: celery/celery
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: main
Choose a base ref
...
head repository: HiredScore/celery
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref
Can’t automatically merge. Don’t worry, you can still create the pull request.
  • 16 commits
  • 6 files changed
  • 4 contributors

Commits on Sep 7, 2022

  1. Copy the full SHA
    38e6e93 View commit details
  2. Copy the full SHA
    c92daf4 View commit details

Commits on Sep 15, 2022

  1. [DEV-9478] make code more generic

    liran committed Sep 15, 2022
    Copy the full SHA
    8677cf3 View commit details
  2. [DEV-9478] revert reformatting

    liran committed Sep 15, 2022
    Copy the full SHA
    2c1f7e1 View commit details
  3. [DEV-9478] new line

    liran committed Sep 15, 2022
    Copy the full SHA
    7e33447 View commit details

Commits on Jan 29, 2023

  1. [DEV-12345] try to fix deps

    liran committed Jan 29, 2023
    Copy the full SHA
    462e203 View commit details
  2. [DEV-13793] try to fix deps

    liran committed Jan 29, 2023
    Copy the full SHA
    6637593 View commit details
  3. [DEV-13793] try to fix deps

    liran committed Jan 29, 2023
    Copy the full SHA
    7ccbf67 View commit details

Commits on Mar 28, 2023

  1. DEV-15311-fix-date-done-field-type

    liran committed Mar 28, 2023
    Copy the full SHA
    d4f1a4e View commit details
  2. Merge pull request #1 from HiredScore/DEV-15311-fix-mongo-backend-dat…

    …e-done-field
    
    DEV-15311-fix-date-done-field-type
    liran-cohen-hs authored Mar 28, 2023

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    933d4c2 View commit details

Commits on Nov 7, 2023

  1. Bump version

    Avner Cohen committed Nov 7, 2023

    Unverified

    No user is associated with the committer email.
    Copy the full SHA
    1f2055a View commit details

Commits on Feb 8, 2024

  1. DEV-23298 fix pymongo compatability

    Shai Katzir committed Feb 8, 2024
    Copy the full SHA
    f630a86 View commit details

Commits on Feb 12, 2024

  1. Copy the full SHA
    28d7f1e View commit details

Commits on Feb 13, 2024

  1. Copy the full SHA
    cc469da View commit details
  2. Merge pull request #4 from HiredScore/DEV-23298-upgrade-pymongo

    Fix pymongo compatability
    shai-katzir-hs authored Feb 13, 2024

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    82680df View commit details
  3. update celery version for pymongo compatible change

    noazemach-hiredscore authored and shai-katzir-hs committed Feb 13, 2024
    Copy the full SHA
    4c65e98 View commit details
Showing with 16 additions and 32 deletions.
  1. +1 −1 celery/__init__.py
  2. +11 −12 celery/backends/mongodb.py
  3. +1 −1 requirements/default.txt
  4. +2 −2 requirements/dev.txt
  5. +1 −1 requirements/extras/mongodb.txt
  6. +0 −15 t/unit/backends/test_mongodb.py
2 changes: 1 addition & 1 deletion celery/__init__.py
Original file line number Diff line number Diff line change
@@ -20,7 +20,7 @@

SERIES = 'cliffs'

__version__ = '4.4.7'
__version__ = '4.5.1'
__author__ = 'Ask Solem'
__contact__ = 'auvipy@gmail.com'
__homepage__ = 'http://celeryproject.org'
23 changes: 11 additions & 12 deletions celery/backends/mongodb.py
Original file line number Diff line number Diff line change
@@ -182,11 +182,19 @@ def decode(self, data):
return data
return super(MongoBackend, self).decode(data)

def current_task_children(self, request=None):
return self.encode(super(MongoBackend, self).current_task_children(request))

def _store_result(self, task_id, result, state,
traceback=None, request=None, **kwargs):
"""Store return value and state of an executed task."""
meta = self._get_result_meta(result=self.encode(result), state=state,
traceback=traceback, request=request)
meta = self._get_result_meta(
result=self.encode(result),
state=state,
traceback=self.encode(traceback),
request=request,
format_date=False
)
# Add the _id for mongodb
meta['_id'] = task_id

@@ -266,16 +274,7 @@ def __reduce__(self, args=(), kwargs=None):

def _get_database(self):
conn = self._get_connection()
db = conn[self.database_name]
if self.user and self.password:
source = self.options.get(
'authsource',
self.database_name or 'admin'
)
if not db.authenticate(self.user, self.password, source=source):
raise ImproperlyConfigured(
'Invalid MongoDB username or password.')
return db
return conn[self.database_name]

@cached_property
def database(self):
2 changes: 1 addition & 1 deletion requirements/default.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pytz>dev
pytz
billiard>=3.6.3.0,<4.0
kombu>=4.6.10,<4.7
vine==1.3.0
4 changes: 2 additions & 2 deletions requirements/dev.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
pytz>dev
pytz
git+https://github.com/celery/kombu.git
git+https://github.com/celery/py-amqp.git
git+https://github.com/celery/billiard.git
vine==1.3.0
vine==1.3.0
2 changes: 1 addition & 1 deletion requirements/extras/mongodb.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
pymongo[srv]>=3.3.0
pymongo[srv]>=3.11.1
15 changes: 0 additions & 15 deletions t/unit/backends/test_mongodb.py
Original file line number Diff line number Diff line change
@@ -277,8 +277,6 @@ def test_get_database_no_existing(self, mock_get_connection):

assert database is mock_database
assert self.backend.__dict__['database'] is mock_database
mock_database.authenticate.assert_called_once_with(
MONGODB_USER, MONGODB_PASSWORD, source=self.backend.database_name)

@patch('celery.backends.mongodb.MongoBackend._get_connection')
def test_get_database_no_existing_no_auth(self, mock_get_connection):
@@ -294,7 +292,6 @@ def test_get_database_no_existing_no_auth(self, mock_get_connection):
database = self.backend.database

assert database is mock_database
mock_database.authenticate.assert_not_called()
assert self.backend.__dict__['database'] is mock_database

@patch('celery.backends.mongodb.MongoBackend._get_database')
@@ -487,18 +484,6 @@ def test_cleanup(self, mock_get_database):
mock_get_database.assert_called_once_with()
mock_collection.delete_many.assert_called()

def test_get_database_authfailure(self):
x = MongoBackend(app=self.app)
x._get_connection = Mock()
conn = x._get_connection.return_value = {}
db = conn[x.database_name] = Mock()
db.authenticate.return_value = False
x.user = 'jerry'
x.password = 'cere4l'
with pytest.raises(ImproperlyConfigured):
x._get_database()
db.authenticate.assert_called_with('jerry', 'cere4l',
source=x.database_name)

def test_prepare_client_options(self):
with patch('pymongo.version_tuple', new=(3, 0, 3)):