OpenMetadata icon indicating copy to clipboard operation
OpenMetadata copied to clipboard

scheduleInterval is not available in api response as well as Airflow web server

Open darth-coder00 opened this issue 5 years ago • 1 comments

Created Ingestion workflow with

{
  "connectorConfig": {
    "database": "string",
    "enableDataProfiler": true,
    "excludeFilterPattern": {},
    "host": "string",
    "includeFilterPattern": [
      "string"
    ],
    "includeViews": true,
    "password": "string",
    "username": "string"
  },
  "description": "string",
  "displayName": "Test 4",
  "forceDeploy": true,
  "name": "test4",
  "owner": {
    "id": "3fa60b3c-cab4-4aeb-8568-e32450476e14",
    "name": "aaron_johnson0",
    "type": "user"
  },
  "pauseWorkflow": false,
  "scheduleInterval": "*/5 * * * *",
  "service": {
    "id": "ace93311-085d-4a78-bfdc-1be0257fdcb8",
    "name": "bigquery",
    "type": "databaseService"
  },
  "startDate": "2021-11-12",
  "workflowCatchup": true
}

Screenshot 2021-11-12 at 11 05 01 PM

darth-coder00 avatar Nov 12 '21 17:11 darth-coder00

@darth-coder00 Here is the fix including adding the status as part of get and list calls

{
	"id": "f82d6501-03b5-4a86-bcc1-6d33d3957235",
	"name": "redshift_ingestion_test_3",
	"displayName": "redshif Ingestion",
	"description": "Redshift Ingestion",
	"fullyQualifiedName": "aws_redshift.redshift_ingestion_test_3",
	"forceDeploy": true,
	"pauseWorkflow": false,
	"concurrency": 1,
	"startDate": "2021-11-13",
	"endDate": "string",
	"nextExecutionDate": "2021-11-13T07:00:00+00:00",
	"workflowTimezone": "UTC",
	"retries": 3,
	"retryDelay": 300,
	"workflowCatchup": false,
	"scheduleInterval": "*/15 * * * *",
	"workflowTimeout": 60,
	"connectorConfig": {
		"username": "awsuser",
		"password": "focguC-kaqqe5-nepsok",
		"host": "redshift-cluster-1.clot5cqn1cnb.us-west-2.redshift.amazonaws.com:5439",
		"database": "warehouse",
		"includeViews": true,
		"enableDataProfiler": true,
		"excludeFilterPattern": {}
	},
	"ingestionStatuses": [{
		"state": "failed",
		"startDate": "2021-11-13T23:16:45.998359+0000",
		"endDate": "2021-11-13T23:16:50.000030+0000"
	}, {
		"state": "failed",
		"startDate": "2021-11-13T23:16:51.044735+0000",
		"endDate": "2021-11-13T23:16:55.045188+0000"
	}, {
		"state": "failed",
		"startDate": "2021-11-13T23:16:55.170797+0000",
		"endDate": "2021-11-13T23:16:59.386361+0000"
	}, {
		"state": "failed",
		"startDate": "2021-11-13T23:17:00.085816+0000",
		"endDate": "2021-11-13T23:17:04.272449+0000"
	}, {
		"state": "failed",
		"startDate": "2021-11-13T23:17:05.140546+0000",
		"endDate": "2021-11-13T23:17:09.324577+0000"
	}, {
		"state": "failed",
		"startDate": "2021-11-13T23:17:10.191535+0000",
		"endDate": "2021-11-13T23:17:14.376885+0000"
	}, {
		"state": "failed",
		"startDate": "2021-11-13T23:17:15.244610+0000",
		"endDate": "2021-11-13T23:17:19.492313+0000"
	}, {
		"state": "failed",
		"startDate": "2021-11-13T23:17:20.294911+0000",
		"endDate": "2021-11-13T23:17:24.476645+0000"
	}, {
		"state": "failed",
		"startDate": "2021-11-13T23:17:25.245506+0000",
		"endDate": "2021-11-13T23:17:29.476040+0000"
	}, {
		"state": "failed",
		"startDate": "2021-11-13T23:17:30.378300+0000",
		"endDate": "2021-11-13T23:17:34.578802+0000"
	}, {
		"state": "failed",
		"startDate": "2021-11-13T23:17:35.428433+0000",
		"endDate": "2021-11-13T23:17:39.609944+0000"
	}, {
		"state": "running",
		"startDate": "2021-11-13T23:17:40.294846+0000"
	}, {
		"state": "queued"
	}, {
		"state": "queued"
	}, {
		"state": "queued"
	}, {
		"state": "queued"
	}, {
		"state": "queued"
	}, {
		"state": "queued"
	}, {
		"state": "queued"
	}, {
		"state": "queued"
	}, {
		"state": "queued"
	}, {
		"state": "queued"
	}, {
		"state": "queued"
	}, {
		"state": "queued"
	}, {
		"state": "queued"
	}, {
		"state": "queued"
	}, {
		"state": "queued"
	}, {
		"state": "queued"
	}],
	"service": {
		"id": "e220ff07-334a-4c2e-9e26-3850f7d03e5a",
		"type": "databaseService",
		"name": "aws_redshift",
		"description": "",
		"href": "http://localhost:8585/api/v1/services/databaseServices/e220ff07-334a-4c2e-9e26-3850f7d03e5a"
	},
	"href": "http://localhost:8585/api/ingestion/f82d6501-03b5-4a86-bcc1-6d33d3957235",
	"version": 0.1,
	"updatedAt": 1636845395962,
	"updatedBy": "anonymous"
}```

nextExecutionDate will only available after at least 1 execution of the workflow. If the user deploys and doesn't do "Run Now" we won't be getting nextExecutionDate. 

Similarly, IngestionStatuses contains all the executions of the workflow. For now sort them by timestamp and display top 5.  I'll work on adding limit to return only top 10.
Also you can see start, end date in the statuses. If there is only endDate that means that instance of the execution is manually trigger which is equivalent user clicking "RunNow" . If it contains start and end date it means the pipeline ran as per schedule by the airflow scheduler. 

@ayush-shah I updated the plugins and released a new version we need to update the airflow docker to pickup changes . The above APIs are supported by new changes

harshach avatar Nov 13 '21 23:11 harshach