Repository: googleapis/python-bigquery

Issue:
Bigquery: Model reference repr seems wrong for model_id
For `ModelReference`'s repr use project_id against model_id

https://github.com/googleapis/python-bigquery/blob/be5c8b1ede9a2d762fd5574c32587d125eca4713/google/cloud/bigquery/model.py#L432-L435

Discussion:
HemangChothani: The failed test has nothing to do with the changes here.
plamut: Indeed, and I will temporarily disable it (as per recent discussion) until that issue gets fixed.
plamut: @HemangChothani Please just update the branch so that we can merge this, thanks!

Patch:
diff --git a/google/cloud/bigquery/model.py b/google/cloud/bigquery/model.py
index d39ec5f2..a2510e86 100644
--- a/google/cloud/bigquery/model.py
+++ b/google/cloud/bigquery/model.py
@@ -430,6 +430,6 @@ class ModelReference(object):
         return hash(self._key())
 
     def __repr__(self):
-        return "ModelReference(project='{}', dataset_id='{}', project_id='{}')".format(
+        return "ModelReference(project_id='{}', dataset_id='{}', model_id='{}')".format(
             self.project, self.dataset_id, self.model_id
         )


Test patch:
diff --git a/tests/unit/model/test_model.py b/tests/unit/model/test_model.py
index bbb93ef9..90fc09e6 100644
--- a/tests/unit/model/test_model.py
+++ b/tests/unit/model/test_model.py
@@ -316,5 +316,5 @@ def test_repr(target_class):
     got = repr(model)
     assert got == (
         "Model(reference=ModelReference("
-        "project='my-proj', dataset_id='my_dset', project_id='my_model'))"
+        "project_id='my-proj', dataset_id='my_dset', model_id='my_model'))"
     )
diff --git a/tests/unit/model/test_model_reference.py b/tests/unit/model/test_model_reference.py
index ff1d1df7..39dabb55 100644
--- a/tests/unit/model/test_model_reference.py
+++ b/tests/unit/model/test_model_reference.py
@@ -136,5 +136,5 @@ def test_repr(target_class):
     got = repr(model)
     assert (
         got
-        == "ModelReference(project='my-proj', dataset_id='my_dset', project_id='my_model')"
+        == "ModelReference(project_id='my-proj', dataset_id='my_dset', model_id='my_model')"
     )