You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2022/10/21 05:43:16 UTC

[GitHub] [airflow] emincanoguz11 opened a new pull request, #27174: BugFix - Druid Airflow Exception to about content

emincanoguz11 opened a new pull request, #27174:
URL: https://github.com/apache/airflow/pull/27174

   Hi,
   This PR is about 
   related: #27029 
   
   I tested with local env and docker. I see that this result
   
   `raise AirflowException(f'The error code of {url}: {req_index.content}')
   airflow.exceptions.AirflowException: The error code of DRUID-URL/druid/indexer/v1/task: b'{"error":"Cannot construct instance of `org.apache.druid.indexer.partitions.DimensionRangePartitionsSpec`, problem: partitionDimensions must be specified\\n at [Source: (org.eclipse.jetty.server.HttpInputOverHTTP); line: 102, column: 7] (through reference chain: org.apache.druid.indexing.common.task.batch.parallel.ParallelIndexSupervisorTask[\\"spec\\"]->org.apache.druid.indexing.common.task.batch.parallel.ParallelIndexIngestionSpec[\\"tuningConfig\\"]->org.apache.druid.indexing.common.task.batch.parallel.ParallelIndexTuningConfig[\\"partitionsSpec\\"])"}'
   `
   
   P.S : I deleted my own Druid Broker host
   
   <img width="1699" alt="Screen Shot 2022-10-20 at 18 04 21" src="https://user-images.githubusercontent.com/47830986/196987190-747ac3cd-d249-45ef-b354-d5c9f418bbc4.png">
   
   Also I take pictures for standarts
   
   
   ![Screen Shot 2022-10-21 at 08 33 31](https://user-images.githubusercontent.com/47830986/197120606-b439aca1-8e8b-48bc-8229-5908c34661a1.png)
   ![Screen Shot 2022-10-21 at 08 33 41](https://user-images.githubusercontent.com/47830986/197120609-fff4054b-6dd6-4704-a4f1-0797e5722129.png)
   ![Screen Shot 2022-10-21 at 08 33 48](https://user-images.githubusercontent.com/47830986/197120611-3114b3af-2ee5-4a4a-b913-938612751c90.png)
   ![Screen Shot 2022-10-21 at 08 34 09](https://user-images.githubusercontent.com/47830986/197120614-342a663d-fd7e-4486-bc31-66aa96b6b8e7.png)
   
   
   
   
   <!--
   Thank you for contributing! Please make sure that your code changes
   are covered with tests. And in case of new features or big changes
   remember to adjust the documentation.
   
   Feel free to ping committers for the review!
   
   related: #27029 
   
   ---
   **^ Add meaningful description above**
   
   Read the **[Pull Request Guidelines](https://github.com/apache/airflow/blob/main/CONTRIBUTING.rst#pull-request-guidelines)** for more information.
   In case of fundamental code changes, an Airflow Improvement Proposal ([AIP](https://cwiki.apache.org/confluence/display/AIRFLOW/Airflow+Improvement+Proposals)) is needed.
   In case of a new dependency, check compliance with the [ASF 3rd Party License Policy](https://www.apache.org/legal/resolved.html#category-x).
   In case of backwards incompatible changes please leave a note in a newsfragment file, named `{pr_number}.significant.rst` or `{issue_number}.significant.rst`, in [newsfragments](https://github.com/apache/airflow/tree/main/newsfragments).
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [airflow] potiuk commented on pull request #27174: BugFix - Druid Airflow Exception to about content

Posted by GitBox <gi...@apache.org>.
potiuk commented on PR #27174:
URL: https://github.com/apache/airflow/pull/27174#issuecomment-1296427652

   You need to rebase I am afraid 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [airflow] emincanoguz11 commented on a diff in pull request #27174: BugFix - Druid Airflow Exception to about content

Posted by GitBox <gi...@apache.org>.
emincanoguz11 commented on code in PR #27174:
URL: https://github.com/apache/airflow/pull/27174#discussion_r1002399648


##########
airflow/providers/apache/druid/hooks/druid.py:
##########
@@ -89,7 +89,8 @@ def submit_indexing_job(self, json_index_spec: dict[str, Any] | str) -> None:
         self.log.info("Druid ingestion spec: %s", json_index_spec)
         req_index = requests.post(url, data=json_index_spec, headers=self.header, auth=self.get_auth())
         if req_index.status_code != 200:
-            raise AirflowException(f'Did not get 200 when submitting the Druid job to {url}')
+            raise AirflowException(f'The error code of {url}: {req_index.content}')

Review Comment:
   Hi Nikolas,
   
   Good advice. I changed that. 



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [airflow] o-nikolas commented on pull request #27174: BugFix - Druid Airflow Exception to about content

Posted by GitBox <gi...@apache.org>.
o-nikolas commented on PR #27174:
URL: https://github.com/apache/airflow/pull/27174#issuecomment-1290947154

   @uranusjr has run the build workflow on you PR and there were some static check failures, you'll need to patch those up.
   You can enable pre-commit to easily run static checks on your code ([readme](https://github.com/apache/airflow/blob/main/STATIC_CODE_CHECKS.rst#installing-pre-commit-hooks)).
   
   Do also rebase your branch since some changes were recently merged to standardize quoting in the Airflow codebase.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [airflow] o-nikolas commented on pull request #27174: BugFix - Druid Airflow Exception to about content

Posted by GitBox <gi...@apache.org>.
o-nikolas commented on PR #27174:
URL: https://github.com/apache/airflow/pull/27174#issuecomment-1291466603

   > Thanks Nikolas. I am very busy for this weekend. I will check on Friday.
   
   No worries, thanks for sticking with it :)
   
   > P.S @o-nikolas Is this problem about character number or write type? I don't know.
   > 
   > <img alt="Screen Shot 2022-10-25 at 21 58 33" width="699" src="https://user-images.githubusercontent.com/47830986/197859049-9bea0ec0-d212-4c4c-8cfc-44287000a1bf.png">
   
   This is mypy warning you that at least one of the strings you're formatting here is a byte string, and that Python 3 doesn't handle this edge case gracefully when formatting with f-strings.
   You can see from the example output in the screenshot you linked in the description that the logged output contains the `b` prefix: `... b'{"error":...`. calling a `.decode('utf-8')` on the values which are bytstrings will likely solve your issue (assuming they're utf-8 encoded).


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [airflow] emincanoguz11 commented on pull request #27174: BugFix - Druid Airflow Exception to about content

Posted by GitBox <gi...@apache.org>.
emincanoguz11 commented on PR #27174:
URL: https://github.com/apache/airflow/pull/27174#issuecomment-1296563824

   @potiuk Today, I will rebase and change. Thanks to approved


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [airflow] emincanoguz11 commented on pull request #27174: BugFix - Druid Airflow Exception to about content

Posted by GitBox <gi...@apache.org>.
emincanoguz11 commented on PR #27174:
URL: https://github.com/apache/airflow/pull/27174#issuecomment-1296585764

   Can I correct PR? I rebased but I changed the PR. But I get error in workflow. I don't know.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [airflow] boring-cyborg[bot] commented on pull request #27174: BugFix - Druid Airflow Exception to about content

Posted by GitBox <gi...@apache.org>.
boring-cyborg[bot] commented on PR #27174:
URL: https://github.com/apache/airflow/pull/27174#issuecomment-1286487354

   Congratulations on your first Pull Request and welcome to the Apache Airflow community! If you have any issues or are unsure about any anything please check our Contribution Guide (https://github.com/apache/airflow/blob/main/CONTRIBUTING.rst)
   Here are some useful points:
   - Pay attention to the quality of your code (flake8, mypy and type annotations). Our [pre-commits]( https://github.com/apache/airflow/blob/main/STATIC_CODE_CHECKS.rst#prerequisites-for-pre-commit-hooks) will help you with that.
   - In case of a new feature add useful documentation (in docstrings or in `docs/` directory). Adding a new operator? Check this short [guide](https://github.com/apache/airflow/blob/main/docs/apache-airflow/howto/custom-operator.rst) Consider adding an example DAG that shows how users should use it.
   - Consider using [Breeze environment](https://github.com/apache/airflow/blob/main/BREEZE.rst) for testing locally, it's a heavy docker but it ships with a working Airflow and a lot of integrations.
   - Be patient and persistent. It might take some time to get a review or get the final approval from Committers.
   - Please follow [ASF Code of Conduct](https://www.apache.org/foundation/policies/conduct) for all communication including (but not limited to) comments on Pull Requests, Mailing list and Slack.
   - Be sure to read the [Airflow Coding style]( https://github.com/apache/airflow/blob/main/CONTRIBUTING.rst#coding-style-and-best-practices).
   Apache Airflow is a community-driven project and together we are making it better 🚀.
   In case of doubts contact the developers at:
   Mailing List: dev@airflow.apache.org
   Slack: https://s.apache.org/airflow-slack
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [airflow] emincanoguz11 commented on pull request #27174: BugFix - Druid Airflow Exception to about content

Posted by GitBox <gi...@apache.org>.
emincanoguz11 commented on PR #27174:
URL: https://github.com/apache/airflow/pull/27174#issuecomment-1290999494

   Thanks Nikolas. I am very busy for this weekend. I will check on Friday. 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [airflow] potiuk closed pull request #27174: BugFix - Druid Airflow Exception to about content

Posted by GitBox <gi...@apache.org>.
potiuk closed pull request #27174: BugFix - Druid Airflow Exception to about content
URL: https://github.com/apache/airflow/pull/27174


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [airflow] uranusjr commented on pull request #27174: BugFix - Druid Airflow Exception to about content

Posted by GitBox <gi...@apache.org>.
uranusjr commented on PR #27174:
URL: https://github.com/apache/airflow/pull/27174#issuecomment-1296681932

   I merged main and moved the error message to task log instead, since the HTTP response string can be potentially long and not belong to the exception.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [airflow] o-nikolas commented on a diff in pull request #27174: BugFix - Druid Airflow Exception to about content

Posted by GitBox <gi...@apache.org>.
o-nikolas commented on code in PR #27174:
URL: https://github.com/apache/airflow/pull/27174#discussion_r1002208194


##########
airflow/providers/apache/druid/hooks/druid.py:
##########
@@ -89,7 +89,8 @@ def submit_indexing_job(self, json_index_spec: dict[str, Any] | str) -> None:
         self.log.info("Druid ingestion spec: %s", json_index_spec)
         req_index = requests.post(url, data=json_index_spec, headers=self.header, auth=self.get_auth())
         if req_index.status_code != 200:
-            raise AirflowException(f'Did not get 200 when submitting the Druid job to {url}')
+            raise AirflowException(f'The error code of {url}: {req_index.content}')

Review Comment:
   I find the wording here a little misleading, you're not actually logging a satus code, but rather the response body which contains the error message and traces. Maybe something like:
   
   ```suggestion
               raise AirflowException(f'Failed when submitting the Druid job to {url}. Status code: {req_index.status_code}, response: {req_index.content}')
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org