From 334872beb3082eda752bc8de74ac41a0a18bc2d8 Mon Sep 17 00:00:00 2001 From: = <=> Date: Thu, 30 Jan 2025 09:28:45 +0000 Subject: [PATCH 1/7] added id to mock collection.id --- mockfirestore/collection.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/mockfirestore/collection.py b/mockfirestore/collection.py index 431c074..b377d0f 100644 --- a/mockfirestore/collection.py +++ b/mockfirestore/collection.py @@ -13,6 +13,9 @@ def __init__(self, data: Store, path: List[str], self._data = data self._path = path self.parent = parent + self.id = None + if len(path): + self.id = path[0] def document(self, document_id: Optional[str] = None) -> DocumentReference: collection = get_by_path(self._data, self._path) From 06a796c909ae89ea7db3526aa67e322970dce774 Mon Sep 17 00:00:00 2001 From: = <=> Date: Thu, 30 Jan 2025 09:31:07 +0000 Subject: [PATCH 2/7] Fixed TypeError with stream where object comparisons werent possible due to the code not explcitly converting uuid objects to strings --- mockfirestore/collection.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mockfirestore/collection.py b/mockfirestore/collection.py index b377d0f..da1de8a 100644 --- a/mockfirestore/collection.py +++ b/mockfirestore/collection.py @@ -83,6 +83,6 @@ def list_documents(self, page_size: Optional[int] = None) -> Sequence[DocumentRe return docs def stream(self, transaction=None) -> Iterable[DocumentSnapshot]: - for key in sorted(get_by_path(self._data, self._path)): + for key in sorted({str(k):v for k,v in get_by_path(self._data, self._path).items()}): doc_snapshot = self.document(key).get() yield doc_snapshot From 739a69c31cc1f70ed0c33d01b7e8e1ac06bd4e89 Mon Sep 17 00:00:00 2001 From: = <=> Date: Fri, 31 Jan 2025 11:52:20 +0000 Subject: [PATCH 3/7] test --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 40a4ba9..07f13d1 100644 --- a/README.md +++ b/README.md @@ -130,3 +130,4 @@ transaction.commit() * [William Li](https://github.com/wli) * [Ugo Marchand](https://github.com/UgoM) * [Bryce Thornton](https://github.com/brycethornton) + From ac1a4da6443e174c495e3d2e85fcccf866204e42 Mon Sep 17 00:00:00 2001 From: = <=> Date: Fri, 31 Jan 2025 11:55:34 +0000 Subject: [PATCH 4/7] changed version in test.yml --- .github/workflows/test.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 41a7cd6..1116a3f 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -9,9 +9,9 @@ jobs: python-version: [ '3.6', '3.7', '3.8', '3.9', '3.10' ] steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v2 + uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} - name: Install dependencies From a681861a457cf67aed1ac9ad95dc7d3e892b7304 Mon Sep 17 00:00:00 2001 From: = <=> Date: Fri, 31 Jan 2025 11:58:08 +0000 Subject: [PATCH 5/7] changed image to ubunto to 22.04 --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 1116a3f..896bd40 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -3,7 +3,7 @@ on: [push, pull_request] jobs: test: - runs-on: ubuntu-latest + runs-on: ubuntu-22.04 strategy: matrix: python-version: [ '3.6', '3.7', '3.8', '3.9', '3.10' ] From ddbc378eaad7e81333aaa2c947d789ec63e1619e Mon Sep 17 00:00:00 2001 From: = <=> Date: Fri, 31 Jan 2025 12:02:15 +0000 Subject: [PATCH 6/7] Removed 3.6 from testing as not supported GHA anymore --- .github/workflows/test.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 896bd40..96d5e5b 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -3,10 +3,10 @@ on: [push, pull_request] jobs: test: - runs-on: ubuntu-22.04 + runs-on: ubuntu-latest strategy: matrix: - python-version: [ '3.6', '3.7', '3.8', '3.9', '3.10' ] + python-version: [ '3.7', '3.8', '3.9', '3.10', '3.11', '3.12'] steps: - uses: actions/checkout@v4 From 00cd182142c5eb09e4815e7f20335746f5533fde Mon Sep 17 00:00:00 2001 From: = <=> Date: Fri, 31 Jan 2025 12:07:38 +0000 Subject: [PATCH 7/7] Removed python 3.7 from GHA as unsupported --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 96d5e5b..d6b5045 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -6,7 +6,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: [ '3.7', '3.8', '3.9', '3.10', '3.11', '3.12'] + python-version: [ '3.8', '3.9', '3.10', '3.11', '3.12'] steps: - uses: actions/checkout@v4