nebius/SWE-bench-extra huggingface dataset:
Repository: RockefellerArchiveCenter/DACSspace

Issue:
Address filename conventions/extension
@daremiyo discovered that troublesome filenames (filenames with spaces and no extensions provided) will pass tests. We might want to consider building out a solution to this:

- Enhance the TestReporter class to include testing for specific filenames/characters/extensions
- Have the code fudge a troublesome filename into a better filename (remove spaces, add extension)
- Remove the option to include a filename. Instead, always use the same filename and always save the file in the same location with a standard filename or a filename based on the timestamp.

For additional information, see @daremiyo comment on PR #39 

> One thing to note for us to consider is how we should handle filename conventions for the file to which the results are being written. Do we want to specify a file extension like .csv; specify what characters shouldn’t be included like spaces, etc.

Comments:

Patch:
diff --git a/dacsspace/dacsspace.py b/dacsspace/dacsspace.py
index b953a5b..35118e7 100644
--- a/dacsspace/dacsspace.py
+++ b/dacsspace/dacsspace.py
@@ -1,3 +1,5 @@
+import re
+
 from .client import ArchivesSpaceClient
 from .reporter import CSVReporter
 from .validator import Validator
@@ -6,6 +8,14 @@ from .validator import Validator
 class DACSspace:
     """Base DACSspace class. Fetches data from AS, validates and reports results."""
 
+    def __init__(self, csv_filepath):
+        """Checks csv filepath to make sure it has the proper extension and characters."""
+        if not csv_filepath.endswith(".csv"):
+            raise ValueError("File must have .csv extension")
+        if re.search(r'[*?:"<>|]', csv_filepath):
+            raise ValueError(
+                'File name cannot contain the following characters: * ? : " < > | ')
+
     def run(self, published_only, invalid_only,
             schema_identifier='single_level_required.json', schema_filepath=None):
         client = ArchivesSpaceClient()


Test patch:
diff --git a/tests/test_dacsspace.py b/tests/test_dacsspace.py
new file mode 100644
index 0000000..87de2f0
--- /dev/null
+++ b/tests/test_dacsspace.py
@@ -0,0 +1,22 @@
+from unittest import TestCase
+
+from dacsspace import DACSspace
+
+
+class TestDACSspace(TestCase):
+
+    def test_csv_filepath(self):
+        """Asserts that CSV filepath is handled as expected.
+
+        Filepaths are checked to ensure they end with the appropriate file
+        extension (.csv) and don't contain any illegal characters.
+        """
+        DACSspace("csv_filepath.csv")
+        with self.assertRaises(ValueError) as err:
+            DACSspace("my*file.csv")
+        self.assertEqual(str(err.exception),
+                         'File name cannot contain the following characters: * ? : " < > | ')
+        with self.assertRaises(ValueError) as err:
+            DACSspace("myfile")
+        self.assertEqual(str(err.exception),
+                         "File must have .csv extension")
Repository: RockefellerArchiveCenter/DACSspace

Issue:
TypeError when running dacsspace
**Describe the bug**
When running dacsspace I get this error:
`TypeError: _StoreAction.__init__() got an unexpected keyword argument 'typ'`

**To Reproduce**
Steps to reproduce the behavior:
1. `dacsspace test.csv`
4. See error `TypeError: _StoreAction.__init__() got an unexpected keyword argument 'typ'`

**Expected behavior**
The script to run :)

**Additional context**
Found this [article](https://stackoverflow.com/questions/33574270/typeerror-init-got-an-unexpected-keyword-argument-type-in-argparse), seems like it's argparse messing things up?


Comments:

Patch:
diff --git a/dacsspace/command_line.py b/dacsspace/command_line.py
index d96267a..78bf994 100644
--- a/dacsspace/command_line.py
+++ b/dacsspace/command_line.py
@@ -14,7 +14,7 @@ def main():
     parser.add_argument(
         '--as_config',
         help='Filepath for ArchivesSpace configuration file',
-        typ=str,
+        type=str,
         default='as_config.cfg')
     parser.add_argument(
         '--published_only',
diff --git a/requirements.in b/requirements.in
index 94960cd..2db699d 100644
--- a/requirements.in
+++ b/requirements.in
@@ -1,3 +1,3 @@
 ArchivesSnake==0.9.1
 requests==2.27.1
-jsonschema==4.4.0
+jsonschema==4.6.0
diff --git a/requirements.txt b/requirements.txt
index 72a4b9e..50936a2 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -20,7 +20,7 @@ idna==3.3
     # via requests
 jarowinkler==1.0.2
     # via rapidfuzz
-jsonschema==4.4.0
+jsonschema==4.6.0
     # via -r requirements.in
 more-itertools==8.12.0
     # via archivessnake
diff --git a/setup.py b/setup.py
index 8de4b02..4116e84 100644
--- a/setup.py
+++ b/setup.py
@@ -11,7 +11,7 @@ setup(
     long_description_content_type="text/markdown",
     author="Rockefeller Archive Center",
     author_email="archive@rockarch.org",
-    version="0.1.0",
+    version="0.1.1",
     license='MIT',
     packages=find_packages(),
     entry_points={
diff --git a/tox.ini b/tox.ini
index e3d0701..f16c325 100644
--- a/tox.ini
+++ b/tox.ini
@@ -1,13 +1,11 @@
 [tox]
 envlist = py310, linting
-skipsdist = True
 
 [testenv]
 deps =
 	-rrequirements.txt
 	pytest
 	coverage
-skip_install = True
 commands =
 	coverage run -m pytest -s
 	coverage report -m --omit=tests/*


Test patch:
diff --git a/tests/test_commandline.py b/tests/test_commandline.py
new file mode 100644
index 0000000..4c56358
--- /dev/null
+++ b/tests/test_commandline.py
@@ -0,0 +1,10 @@
+import os
+from unittest import TestCase
+
+
+class CommandLineTest(TestCase):
+
+    def test_command_line(self):
+        """Ensures command line interface does not contain typos."""
+        exit_status = os.system('dacsspace --help')
+        assert exit_status == 0
Repository: Sage-Bionetworks/Genie

Issue:
Modify error message for maf.py check
for _check_tsa1_tsa2 in maf.py, modify error message.

https://github.com/Sage-Bionetworks/Genie/blob/develop/genie_registry/maf.py#L25

Instead of

> The values in TUMOR_SEQ_ALLELE1 must be the same as all the values in REFERENCE_ALLELE OR TUMOR_SEQ_ALLELE2

maybe

> All values  in TUMOR_SEQ_ALLELE1 must match all values in REFERENCE_ALLELE or all values in TUMOR_SEQ_ALLELE2

Comments:

Patch:
diff --git a/genie_registry/maf.py b/genie_registry/maf.py
index f4dae91..714233a 100644
--- a/genie_registry/maf.py
+++ b/genie_registry/maf.py
@@ -25,8 +25,8 @@ def _check_tsa1_tsa2(df):
             error = (
                 "maf: Contains both "
                 "TUMOR_SEQ_ALLELE1 and TUMOR_SEQ_ALLELE2 columns. "
-                "The values in TUMOR_SEQ_ALLELE1 must be the same as "
-                "all the values in REFERENCE_ALELLE OR TUMOR_SEQ_ALLELE2."
+                "All values in TUMOR_SEQ_ALLELE1 must match all values in "
+                "REFERENCE_ALLELE or all values in TUMOR_SEQ_ALLELE2.\n"
             )
     return error
 


Test patch:
diff --git a/tests/test_maf.py b/tests/test_maf.py
index edc9105..75bcecd 100644
--- a/tests/test_maf.py
+++ b/tests/test_maf.py
@@ -211,8 +211,8 @@ def test_invalid__check_tsa1_tsa2():
     assert error == (
         "maf: Contains both "
         "TUMOR_SEQ_ALLELE1 and TUMOR_SEQ_ALLELE2 columns. "
-        "The values in TUMOR_SEQ_ALLELE1 must be the same as "
-        "all the values in REFERENCE_ALELLE OR TUMOR_SEQ_ALLELE2."
+        "All values in TUMOR_SEQ_ALLELE1 must match all values in "
+        "REFERENCE_ALLELE or all values in TUMOR_SEQ_ALLELE2.\n"
     )
Repository: Sage-Bionetworks/Genie

Issue:
Modify check for DEAD variable in clinical file
if DEAD is False, then YEAR_DEATH and INT_DOD must be ‘Not Applicable’
https://www.synapse.org/#!Synapse:syn3380222/wiki/412290

Comments:

Patch:
diff --git a/genie_registry/clinical.py b/genie_registry/clinical.py
index 90fca60..7739b2e 100644
--- a/genie_registry/clinical.py
+++ b/genie_registry/clinical.py
@@ -95,10 +95,10 @@ def _check_int_dead_consistency(clinicaldf: DataFrame) -> str:
     # Check that all string values are equal each other
     is_equal = all(clinicaldf.loc[is_str, "DEAD"] == clinicaldf.loc[is_str, "INT_DOD"])
     # If dead, int column can't be Not Applicable
-    # If alive, int column can't have values
+    # If alive, int column must be Not Applicable
     if (
         any(clinicaldf.loc[is_dead, "INT_DOD"] == "Not Applicable")
-        or not all(clinicaldf.loc[is_alive, "INT_DOD"].isin(allowed_str))
+        or not all(clinicaldf.loc[is_alive, "INT_DOD"] == "Not Applicable")
         or not is_equal
     ):
         return (


Test patch:
diff --git a/tests/test_clinical.py b/tests/test_clinical.py
index 8668f71..18937f2 100644
--- a/tests/test_clinical.py
+++ b/tests/test_clinical.py
@@ -804,8 +804,8 @@ def test__check_int_year_consistency_inconsistent(inconsistent_df,
              "DEAD": [True, False]}
         ),
         pd.DataFrame(
-            {"INT_DOD": [1111, "Not Released"],
-             "DEAD": [True, False]}
+            {"INT_DOD": ["Not Applicable", "Not Applicable"],
+             "DEAD": [False, False]}
         )
     ]
 )
@@ -824,6 +824,10 @@ def test__check_int_dead_consistency_valid(valid_df):
             {"INT_DOD": ["Not Applicable", "Not Applicable"],
              "DEAD": [True, False]}
         ),
+        pd.DataFrame(
+            {"INT_DOD": [1111, "Not Released"],
+             "DEAD": [True, False]}
+        ),
         pd.DataFrame(
             {"INT_DOD": [1111, 11111],
              "DEAD": [True, False]}
Repository: Sage-Bionetworks/Genie

Issue:
Modify vital status inconsistency check
One site reports that they are able to supply the YEAR but not INT of the vital status values.  

Therefore, should allow for a numeric year and `Unknown` INT pattern for both death and contact variable pairs.

Comments:

Patch:
diff --git a/genie_registry/clinical.py b/genie_registry/clinical.py
index cbf1a42..cac16e4 100644
--- a/genie_registry/clinical.py
+++ b/genie_registry/clinical.py
@@ -140,8 +140,14 @@ def _check_int_year_consistency(
     for str_val in string_vals:
         # n string values per row
         n_str = (clinicaldf[cols] == str_val).sum(axis=1)
-        if n_str.between(0, len(cols), inclusive="neither").any():
-            is_text_inconsistent = True
+        # year can be known with unknown interval value
+        # otherwise must be all numeric or the same text value
+        if str_val == "Unknown":
+            if ((n_str == 1) & (clinicaldf[interval_col] != "Unknown")).any():
+                is_text_inconsistent = True
+        else:
+            if n_str.between(0, len(cols), inclusive="neither").any():
+                is_text_inconsistent = True
 
     is_redaction_inconsistent = False
     # Check that the redacted values are consistent


Test patch:
diff --git a/tests/test_clinical.py b/tests/test_clinical.py
index e0d29e0..70e8f1b 100644
--- a/tests/test_clinical.py
+++ b/tests/test_clinical.py
@@ -727,13 +727,13 @@ def test_remap_clinical_values(col):
 def test__check_int_year_consistency_valid():
     """Test valid vital status consistency"""
     testdf = pd.DataFrame(
-        {"INT_2": [1, 2, "Unknown"],
-         "YEAR_1": [1, 4, "Unknown"],
-         "FOO_3": [1, 3, "Unknown"]}
+        {"INT_2": [1, 2, "Unknown", "Unknown"],
+         "YEAR_1": [1, 4, "Unknown", 1],
+         "FOO_3": [1, 3, "Unknown", 1]}
     )
     error = genie_registry.clinical._check_int_year_consistency(
         clinicaldf=testdf,
-        cols=['INT_2', "YEAR_1"],
+        cols=["INT_2", "YEAR_1"],
         string_vals=["Unknown"]
     )
     assert error == ""
@@ -759,7 +759,7 @@ def test__check_int_year_consistency_valid():
         (
             pd.DataFrame(
                 {"INT_2": [1, "Unknown", "Unknown"],
-                 "YEAR_1": [1, 4, "Unknown"]}
+                 "YEAR_1": [1, "Not Applicable", "Unknown"]}
             ),
             "Patient: you have inconsistent text values in INT_2, YEAR_1.\n"
         ),
@@ -780,10 +780,17 @@ def test__check_int_year_consistency_valid():
         (
             pd.DataFrame(
                 {"INT_2": ["<6570", "Unknown", "Unknown"],
-                 "YEAR_1": [1, 3, "Unknown"]}
+                 "YEAR_1": [1, "Not Applicable", "Unknown"]}
             ),
             "Patient: you have inconsistent redaction and text values in "
             "INT_2, YEAR_1.\n"
+        ),
+        (
+            pd.DataFrame(
+                {"INT_2": ["12345", "Unknown", "Unknown"],
+                 "YEAR_1": ["Unknown", "Unknown", "Unknown"]}
+            ),
+            "Patient: you have inconsistent text values in INT_2, YEAR_1.\n"
         )
     ]
 )
Repository: SethMMorton/natsort

Issue:
`os_sorted` fails to sort current directory
**Describe the bug**
`ValueError` is raised when sorting current directory `'.'` or `'./'` or `'.\\'`.

**Expected behavior**
The current directory should be sorted correctly without error.

**Environment (please complete the following information):**
 - Python Version: 3.9
 - OS: both Windows and Ubuntu
 - If the bug involves `LOCALE` or `humansorted`:
    - Is `PyICU` installed? No
    - Do you have a locale set? If so, to what? No

**To Reproduce**

```python
Python 3.9.7 (tags/v3.9.7:1016ef3, Aug 30 2021, 20:19:38) [MSC v.1929 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> from natsort import os_sorted
>>> os_sorted(['.'])
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "D:\Software\Python39\lib\site-packages\natsort\natsort.py", line 929, in os_sorted
    return sorted(seq, key=os_sort_keygen(key), reverse=reverse)
  File "D:\Software\Python39\lib\site-packages\natsort\natsort.py", line 786, in <lambda>
    OSSortKeyType, lambda x: tuple(map(_winsort_key, _split_apply(x, key)))
  File "D:\Software\Python39\lib\site-packages\natsort\natsort.py", line 770, in _split_apply
    return utils.path_splitter(str(v))
  File "D:\Software\Python39\lib\site-packages\natsort\utils.py", line 890, in path_splitter
    *path_parts, base = s.parts
ValueError: not enough values to unpack (expected at least 1, got 0)
```


Comments:

Patch:
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 0077605..159b16c 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,6 +1,9 @@
 Unreleased
 ---
 
+### Fixed
+- Bug where sorting paths fail if one of the paths is '.'.
+
 [8.0.1] - 2021-12-10
 ---
 
diff --git a/natsort/utils.py b/natsort/utils.py
index c9448b4..8d56b06 100644
--- a/natsort/utils.py
+++ b/natsort/utils.py
@@ -887,7 +887,11 @@ def path_splitter(
         s = PurePath(s)
 
     # Split the path into parts.
-    *path_parts, base = s.parts
+    try:
+        *path_parts, base = s.parts
+    except ValueError:
+        path_parts = []
+        base = str(s)
 
     # Now, split off the file extensions until we reach a decimal number at
     # the beginning of the suffix or there are no more extensions.


Test patch:
diff --git a/tests/test_utils.py b/tests/test_utils.py
index 38df303..bb229b9 100644
--- a/tests/test_utils.py
+++ b/tests/test_utils.py
@@ -141,6 +141,14 @@ def test_path_splitter_splits_path_string_by_sep_example() -> None:
     assert tuple(utils.path_splitter(pathlib.Path(given))) == tuple(expected)
 
 
+@pytest.mark.parametrize("given", [".", "./", "./././", ".\\"])
+def test_path_splitter_handles_dot_properly(given: str) -> None:
+    # https://github.com/SethMMorton/natsort/issues/142
+    expected = (os.path.normpath(given),)
+    assert tuple(utils.path_splitter(given)) == expected
+    assert tuple(utils.path_splitter(pathlib.Path(given))) == expected
+
+
 @given(lists(sampled_from(string.ascii_letters), min_size=2).filter(all))
 def test_path_splitter_splits_path_string_by_sep(x: List[str]) -> None:
     z = str(pathlib.Path(*x))
Repository: ShawHahnLab/igseq

Issue:
Identity calculation should disregard gaps and uppercase/lowercase
In using the new `identity` command I realized it should ignore gaps and uppercase/lowercase differences when comparing sequences.

Comments:

Patch:
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 51fd6d2..675a8c1 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -5,7 +5,7 @@
 ### Added
 
  * `identity` command for calculating pairwise identity between arbitrary
-   queries and references ([#31])
+   queries and references ([#31], [#37])
  * Support for showing basic tree topology for Newick-format files in `show`
    command ([#33])
 
@@ -15,6 +15,7 @@
  * broken pipes (such as from `igseq something | something else`) are now
    handled gracefully ([#30])
 
+[#37]: https://github.com/ShawHahnLab/igseq/pull/37
 [#35]: https://github.com/ShawHahnLab/igseq/pull/35
 [#33]: https://github.com/ShawHahnLab/igseq/pull/33
 [#31]: https://github.com/ShawHahnLab/igseq/pull/31
diff --git a/igseq/identity.py b/igseq/identity.py
index e942641..ed23394 100644
--- a/igseq/identity.py
+++ b/igseq/identity.py
@@ -10,7 +10,8 @@ allows, for example, junction sequences from an AIRR tsv as queries and a FASTA
 of known junctions as references.
 
 The scoring is based on a simple global pairwise alignment, with matches scored
-as 1, mismatches and gaps 0.
+as 1, mismatches and gaps 0.  Any existing gaps are removed before comparing
+sequences, and differeces in case (lower/upper) are disregarded.
 """
 
 import logging
@@ -68,5 +69,12 @@ def score_identity(seq1, seq2):
     """
     # These can be strings or Seq objects, but not SeqRecords.
     if seq1 and seq2:
+        # We'll disregard gaps and case.  If whatever these objects are can't
+        # handle those methods we'll throw a ValueError.
+        try:
+            seq1 = seq1.replace("-", "").upper()
+            seq2 = seq2.replace("-", "").upper()
+        except AttributeError as err:
+            raise ValueError("score_identity arguments should be Seq objects or strings") from err
         return ALIGNER.score(seq1, seq2)/max(len(seq1), len(seq2))
     return 0


Test patch:
diff --git a/test_igseq/test_identity.py b/test_igseq/test_identity.py
index 47738b0..9c4226e 100644
--- a/test_igseq/test_identity.py
+++ b/test_igseq/test_identity.py
@@ -138,6 +138,8 @@ class TestScoreIdentity(unittest.TestCase):
         # without also needing a lot of extra metadata tracking.)
         cases = [
             ("ACTG", "ACTG", 1.00), # identical
+            ("AC-G", "A-CG", 1.00), # identical (gaps disregarded)
+            ("ACTG", "actg", 1.00), # identical (case disregarded)
             ("ACTG",     "", 0.00), # one blank -> 0 by definition
             (    "", "ACTG", 0.00), # other blank -> 0 by definition
             (    "",     "", 0.00), # both blank -> 0 by definition
Repository: Shoobx/mypy-zope

Issue:
Caching error (Metaclass conflict) with mypy 0.991
Hi. With the latest version of mypy (0.991) and mypy-zope (0.3.11) we're getting mypy errors that I think are cache related. The error goes away after `rm -rf .mypy_cache`

Here's the easiest repro I could make:

iface.py
```
from zope.interface import Interface
from zope.interface import implementer

class ISomething(Interface):
    pass

class ISomething2(Interface):
    pass

@implementer(ISomething)
class OneInterface:
    pass

@implementer(ISomething, ISomething2)
class TwoInterfaces:
    pass
```

foo.py
```
from iface import OneInterface, TwoInterfaces

class Good(OneInterface):
    pass

class Bad(TwoInterfaces):
    pass
```

I am able to reliably hit the problem by running the following commands:
```
$ rm -rf .mypy_cache
$ mypy iface.py 
Success: no issues found in 1 source file
$ mypy foo.py 
foo.py:6: error: Metaclass conflict: the metaclass of a derived class must be a (non-strict) subclass of the metaclasses of all its bases  [misc]
Found 1 error in 1 file (checked 1 source file)
```

As you can tell this only happens when there are multiple interfaces.


Comments:

Patch:
diff --git a/src/mypy_zope/plugin.py b/src/mypy_zope/plugin.py
index 46bdc1b..0c7971e 100644
--- a/src/mypy_zope/plugin.py
+++ b/src/mypy_zope/plugin.py
@@ -698,7 +698,10 @@ class ZopeInterfacePlugin(Plugin):
         if not any(promote in ti._promote for ti in impl.mro):
             faketi = TypeInfo(SymbolTable(), iface.defn, iface.module_name)
             faketi._promote = [promote]
-            impl.mro.append(faketi)
+            faketi.metaclass_type = iface.metaclass_type
+            # Insert the TypeInfo before the builtins.object that's at the end.
+            assert impl.mro[-1].fullname == 'builtins.object'
+            impl.mro.insert(len(impl.mro) - 1, faketi)
 
 
 def plugin(version: str) -> PyType[Plugin]:


Test patch:
diff --git a/tests/test_mro_calculation.py b/tests/test_mro_calculation.py
index a051dcc..eb9cf5d 100644
--- a/tests/test_mro_calculation.py
+++ b/tests/test_mro_calculation.py
@@ -59,10 +59,10 @@ def test_mro_computation_in_forward_reference_to_implementer(mypy_cache_dir: str
     mro: List[TypeInfo] = node.node.mro
     # Expected: [
     #   <TypeInfo forward_reference_to_implementer.Protocol@21>,
-    #   <TypeInfo builtins.object>,
     #   <TypeInfo forward_reference_to_implementer.IProtocol>,
+    #   <TypeInfo builtins.object>,
     # ]
     assert len(mro) == 3
     assert mro[0].fullname.startswith(f"{sample_name}.Protocol")
-    assert mro[1].fullname == "builtins.object"
-    assert mro[2].fullname == f"{sample_name}.IProtocol"
+    assert mro[1].fullname == f"{sample_name}.IProtocol"
+    assert mro[2].fullname == "builtins.object"
Repository: Shopify/shopify_python_api

Issue:
TypeError: not all arguments converted during string formatting in /resources/events.py
Getting the following error trying query order events
```
>>> import shopify
>>> shopify.Order.find(2098647662664).events()
Traceback (most recent call last):
  File "<console>", line 1, in <module>
  File "/usr/local/lib/python3.6/site-packages/shopify/mixins.py", line 36, in events
    return shopify.resources.Event.find(resource=self.__class__.plural, resource_id=self.id)
  File "/usr/local/lib/python3.6/site-packages/pyactiveresource/activeresource.py", line 385, in find
    return cls._find_every(from_=from_, **kwargs)
  File "/usr/local/lib/python3.6/site-packages/pyactiveresource/activeresource.py", line 522, in _find_every
    path = cls._collection_path(prefix_options, query_options)
  File "/usr/local/lib/python3.6/site-packages/pyactiveresource/activeresource.py", line 613, in _collection_path
    'prefix': cls._prefix(prefix_options),
  File "/usr/local/lib/python3.6/site-packages/shopify/resources/event.py", line 10, in _prefix
    return "%s/s/%s" % (cls.site, resource, options["resource_id"])
TypeError: not all arguments converted during string formatting
```
there appears to a missing percent sign for the string formatter:
https://github.com/Shopify/shopify_python_api/blob/master/shopify/resources/event.py#L10

Comments:

Patch:
diff --git a/shopify/resources/event.py b/shopify/resources/event.py
index 5d266d0..0fc1e6f 100644
--- a/shopify/resources/event.py
+++ b/shopify/resources/event.py
@@ -7,6 +7,6 @@ class Event(ShopifyResource):
     def _prefix(cls, options={}):
         resource = options.get("resource")
         if resource:
-            return "%s/s/%s" % (cls.site, resource, options["resource_id"])
+            return "%s/%s/%s" % (cls.site, resource, options["resource_id"])
         else:
             return cls.site


Test patch:
diff --git a/test/event_test.py b/test/event_test.py
new file mode 100644
index 0000000..67e8033
--- /dev/null
+++ b/test/event_test.py
@@ -0,0 +1,12 @@
+import shopify
+from test.test_helper import TestCase
+
+class EventTest(TestCase):
+    def test_prefix_uses_resource(self):
+        prefix = shopify.Event._prefix(options={'resource': "orders", "resource_id": 42})
+        self.assertEqual("https://this-is-my-test-show.myshopify.com/admin/api/unstable/orders/42", prefix)
+
+    def test_prefix_doesnt_need_resource(self):
+        prefix = shopify.Event._prefix()
+        self.assertEqual("https://this-is-my-test-show.myshopify.com/admin/api/unstable", prefix)
+