nebius/SWE-bench-extra huggingface dataset:
Repository: NCAS-CMS/cfdm

Issue:
`Data.__str__` fails when the data contains date-times with the first element masked
At cfdm v1.10.0.0 we have:

```python
>>> # v1.10.0.0
>>> import cfdm
>>> import numpy as 
>>> dt = np.ma.array([10, 20], mask=[True, False])
>>> d = cfdm.Data(dt, units='days since 2000-01-01')
>>> str(d)
Traceback
    ...
TypeError: unsupported operand type(s) for +: 'cftime._cftime.DatetimeGregorian' and 'NoneType'
```
but what we expect is 
```python
>>> # Expected behaviour:
>>> d = cfdm.Data(dt, units='days since 2000-01-01')
>>> str(d)
'[--, 2000-01-21 00:00:00]'

```

Comments:

Patch:
diff --git a/Changelog.rst b/Changelog.rst
index f16852e30..5f750fc13 100644
--- a/Changelog.rst
+++ b/Changelog.rst
@@ -1,3 +1,12 @@
+Version 1.10.0.1
+----------------
+
+**2022-??-??**
+
+* Fixed bug that caused a failure when printing date-time data with
+  the first element masked
+  (https://github.com/NCAS-CMS/cfdm/issues/211)
+
 Version 1.10.0.0
 ----------------
 
diff --git a/cfdm/data/data.py b/cfdm/data/data.py
index a48650843..d0c428873 100644
--- a/cfdm/data/data.py
+++ b/cfdm/data/data.py
@@ -506,13 +506,13 @@ class Data(Container, NetCDFHDF5, core.Data):
 
         mask = [False, False, False]
 
+        if isreftime and first is np.ma.masked:
+            first = 0
+            mask[0] = True
+
         if size == 1:
             if isreftime:
                 # Convert reference time to date-time
-                if first is numpy.ma.masked:
-                    first = 0
-                    mask[0] = True
-
                 try:
                     first = type(self)(
                         numpy.ma.array(first, mask=mask[0]), units, calendar


Test patch:
diff --git a/cfdm/test/test_Data.py b/cfdm/test/test_Data.py
index fd1a15182..4960a4f9b 100644
--- a/cfdm/test/test_Data.py
+++ b/cfdm/test/test_Data.py
@@ -68,6 +68,13 @@ class DataTest(unittest.TestCase):
             _ = repr(d)
             _ = str(d)
 
+        # Test when the data contains date-times with the first
+        # element masked
+        dt = numpy.ma.array([10, 20], mask=[True, False])
+        d = cfdm.Data(dt, units="days since 2000-01-01")
+        self.assertTrue(str(d) == "[--, 2000-01-21 00:00:00]")
+        self.assertTrue(repr(d) == "<Data(2): [--, 2000-01-21 00:00:00]>")
+
     #    def test_Data__getitem__(self):
     def test_Data__setitem__(self):
         """Test the assignment of data items on Data."""
Repository: OCA/oca-github-bot

Issue:
ocabot migration duplicating lines in migration issue?
See for example https://github.com/OCA/server-env/issues/120 where the issue was created correctly but now lines with references to a PR are duplicated.

Comments:

Patch:
diff --git a/src/oca_github_bot/tasks/migration_issue_bot.py b/src/oca_github_bot/tasks/migration_issue_bot.py
index 510c435..b4911a7 100644
--- a/src/oca_github_bot/tasks/migration_issue_bot.py
+++ b/src/oca_github_bot/tasks/migration_issue_bot.py
@@ -39,7 +39,7 @@ def _set_lines_issue(gh_pr_user_login, gh_pr_number, issue_body, module):
         if added:  # Bypass the checks for faster completion
             lines.append(line)
             continue
-        groups = re.match(rf"^- \[( |x)\] {module}( |\r)", line)
+        groups = re.match(rf"^- \[( |x)\] \b{module}\b", line)
         if groups:  # Line found
             # Get the Old PR value
             regex = r"\#(\d*)"


Test patch:
diff --git a/tests/test_migration_issue_bot.py b/tests/test_migration_issue_bot.py
index 1cd703d..5ace8f7 100644
--- a/tests/test_migration_issue_bot.py
+++ b/tests/test_migration_issue_bot.py
@@ -53,6 +53,14 @@ def test_set_lines_issue(gh):
             f"- [x] {module} - By @{gh_pr_user_login} - #{gh_pr_number}\n"
             f"- [ ] z_module_1 - By @pedrobaeza - #2",
         ),
+        (
+            f"Issue with list containing the module with no PR\n"
+            f"- [x] {module}\n"
+            f"- [ ] z_module_1 - By @pedrobaeza - #2",
+            f"Issue with list containing the module with no PR\n"
+            f"- [x] {module} - By @{gh_pr_user_login} - #{gh_pr_number}\n"
+            f"- [ ] z_module_1 - By @pedrobaeza - #2",
+        ),
         (
             "Issue with no list",
             f"Issue with no list\n"
Repository: Open-EO/openeo-pg-parser-python

Issue:
Unclear error when JSON file not found
Currently, when the input JSON file (or related python dict) is not found, the following error is returned:
`UnboundLocalError: local variable 'pg_dict' referenced before assignment`

This is not clear and very unfriendly to debug, add check if input file exists or if input dict is not empty.

Comments:

Patch:
diff --git a/src/openeo_pg_parser_python/translate_process_graph.py b/src/openeo_pg_parser_python/translate_process_graph.py
index bbbffde..3982dcd 100644
--- a/src/openeo_pg_parser_python/translate_process_graph.py
+++ b/src/openeo_pg_parser_python/translate_process_graph.py
@@ -216,10 +216,12 @@ def link_nodes(graph):
 
 def translate_graph(pg_filepath):
     if isinstance(pg_filepath, str):
-        if os.path.isfile(pg_filepath):
-            pg_dict = load(open(pg_filepath))
+        pg_dict = load(open(pg_filepath))
     elif isinstance(pg_filepath, dict):
         pg_dict = pg_filepath
+    else:
+        raise ValueError("'pg_filepath must either be file path to a JSON file or a dictionary.'")
+
     nodes = OrderedDict()
     nodes, _, _, _ = walk_pg_graph(nodes, pg_dict)
     # create graph object


Test patch:
diff --git a/tests/test_translate_pg.py b/tests/test_translate_pg.py
new file mode 100644
index 0000000..20140b8
--- /dev/null
+++ b/tests/test_translate_pg.py
@@ -0,0 +1,21 @@
+import unittest
+from openeo_pg_parser_python.translate_process_graph import translate_graph
+
+
+class PGTranslateTester(unittest.TestCase):
+    """ Responsible for testing the translation of an openEO process graph. """
+
+    def setUp(self):
+        """ Specifies paths to the test data. """
+
+        self.pg_test_1_filepath = r"process_graphs/test_1.json"
+
+    def test_pg_not_found(self):
+        pg_filepath = r"process_graphs/does_not_exist.json"
+        try:
+            translate_graph(pg_filepath)
+        except FileNotFoundError:
+            assert True
+
+if __name__ == '__main__':
+    unittest.main()
\ No newline at end of file