Skip to content

Commit

Permalink
Bump marquez-python to 0.5.0 (apache#27)
Browse files Browse the repository at this point in the history
  • Loading branch information
wslulciuc committed May 30, 2019
1 parent 53d5d16 commit 028f291
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 10 deletions.
7 changes: 3 additions & 4 deletions marquez_airflow/dag.py
Expand Up @@ -14,7 +14,7 @@
import pendulum
import airflow.models

from marquez_client.client import Client
from marquez_client import MarquezClient
from marquez_airflow.utils import JobIdMapping


Expand Down Expand Up @@ -63,7 +63,6 @@ def handle_callback(self, *args, **kwargs):

def report_jobrun(self, run_args, execution_date):
job_name = self.dag_id
job_run_args = run_args
start_time = DAG.to_airflow_time(execution_date)
end_time = self.compute_endtime(execution_date)
marquez_client = self.get_marquez_client()
Expand All @@ -73,7 +72,7 @@ def report_jobrun(self, run_args, execution_date):
self.marquez_input_urns, self.marquez_output_urns,
description=self.description)
marquez_jobrun = marquez_client.create_job_run(
job_name, job_run_args=job_run_args,
job_name, run_args=run_args,
nominal_start_time=start_time,
nominal_end_time=end_time)

Expand Down Expand Up @@ -119,7 +118,7 @@ def log_marquez_event(self, args):

def get_marquez_client(self):
if not self._marquez_client:
self._marquez_client = Client(
self._marquez_client = MarquezClient(
namespace_name=self.marquez_namespace)
self._marquez_client.create_namespace(self.marquez_namespace,
"default_owner")
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Expand Up @@ -29,6 +29,6 @@
url="https://github.com/MarquezProject/marquez-airflow",
packages=setuptools.find_packages(),
install_requires=[
"marquez-python==0.3.2"
"marquez-python==0.5.0"
],
)
4 changes: 2 additions & 2 deletions tests/integration/integration_test.py
Expand Up @@ -10,7 +10,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.

from marquez_client.client import Client
from marquez_client import MarquezClient

import logging
import os
Expand All @@ -27,7 +27,7 @@ def test_data_in_marquez(wait_for_marquez, init_airflow_db):
execution_date = "2019-02-01T00:00:00"
namespace = "integration-test"

c = Client(namespace_name=namespace)
c = MarquezClient(namespace_name=namespace)

assert(trigger_dag(dag_id, execution_date))
assert(check_dag_state(dag_id, execution_date))
Expand Down
6 changes: 3 additions & 3 deletions tests/test_dag_extension.py
Expand Up @@ -13,7 +13,7 @@
from airflow.utils.state import State
from contextlib import contextmanager
from datetime import datetime
from marquez_client.client import Client
from marquez_client import MarquezClient
from marquez_airflow import DAG
from unittest.mock import Mock, create_autospec, patch

Expand Down Expand Up @@ -130,7 +130,7 @@ def assert_marquez_calls_for_dagrun(test_dag):
test_dag.output_urns, description=test_dag.description)

marquez_client.create_job_run.assert_called_once_with(
test_dag.dag_id, job_run_args="{}",
test_dag.dag_id, run_args="{}",
nominal_start_time=DAG.to_airflow_time(test_dag.start_date),
nominal_end_time=test_dag.marquez_dag.compute_endtime(
test_dag.start_date))
Expand All @@ -139,7 +139,7 @@ def assert_marquez_calls_for_dagrun(test_dag):
def make_mock_marquez_client(run_id):
mock_marquez_jobrun = Mock()
mock_marquez_jobrun.run_id = run_id
mock_marquez_client = create_autospec(Client)
mock_marquez_client = create_autospec(MarquezClient)
mock_marquez_client.create_job_run.return_value = mock_marquez_jobrun
return mock_marquez_client

Expand Down

0 comments on commit 028f291

Please sign in to comment.