Skip to content

Conversation

@ephraimbuddy
Copy link
Contributor

@ephraimbuddy ephraimbuddy commented Jun 1, 2020


Closes: #8127
Make sure to mark the boxes below before creating PR: [x]

  • Description above provides context of the change
  • Unit tests coverage for changes (not needed for documentation changes)
  • Target Github ISSUE in description if exists
  • Commits follow "How to write a good git commit message"
  • Relevant documentation is updated including usage instructions.
  • I will engage committers as explained in Contribution Workflow Example.

In case of fundamental code change, Airflow Improvement Proposal (AIP) is needed.
In case of a new dependency, check compliance with the ASF 3rd Party License Policy.
In case of backwards incompatible changes please leave a note in UPDATING.md.
Read the Pull Request Guidelines for more information.

@ephraimbuddy ephraimbuddy marked this pull request as draft June 1, 2020 14:54
@ephraimbuddy ephraimbuddy changed the title [WIP] Add connection schema [WIP] Add connection schema and endpoints Jun 1, 2020
@mik-laj mik-laj added the area:API Airflow's REST/HTTP API label Jun 1, 2020
@ephraimbuddy ephraimbuddy changed the title [WIP] Add connection schema and endpoints Add readonly connection endpoints Jun 3, 2020
@ephraimbuddy ephraimbuddy marked this pull request as ready for review June 3, 2020 00:37
Copy link
Member

@turbaszek turbaszek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@turbaszek turbaszek requested a review from mik-laj June 3, 2020 18:26
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great idea. I wonder if pagination is handled here correctly? When we have 100 entries in the database, the user will fetch only two entries (limit = 2), then total_entires should still be 100.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have not tried pagination. Let me write a testcase for it

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It works on pagination. I will push now. Please, Is there a way I can change this PR back to draft?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can convert PR to draft
Screenshot_20200604-213646

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should add nullable to the specification in a few places. This was not done early because we focused on the general API specification.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That would be great,

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems to me that we could do this by extending the fields.String or fields.Int class. It will be clearer.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good. I will try it

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi, I was not able to fix this by extending fields but adding nullable to the specification like you said fixed it. This is the fix 819e036
Also I am thinking that the spec changes can be done in a separate PR

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also I am thinking that the spec changes can be done in a separate PR

You can suggest it. For me, it's okay if the changes are proposed with context.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add support for 404 as well?

@ephraimbuddy ephraimbuddy marked this pull request as draft June 4, 2020 19:44
@ephraimbuddy ephraimbuddy changed the title Add readonly connection endpoints [WIP]Add readonly connection endpoints Jun 4, 2020
@vbmade2000
Copy link

A question. Should we have a directory/filename with package name in it ? Like here we have airflow/api_connexion/endpoints/connection_endpoint.py. This path contains connexion name in it. IMHO code should not reflect underlying package. Just my opinion.

@mik-laj
Copy link
Member

mik-laj commented Jun 6, 2020

@vbmade2000 Packages should clearly show the content. We already have the api package, so I had to use another package that best describes its content. api_connexion is best in my opinion, because we rely on connexion

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This fielld should be non-nullable. I created separate PR about the database schema.
#9187

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok. Can you do rebase? My change has been merged.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I hurriedly pushed now. I will still come back to it this night. e40d532

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1

@mik-laj
Copy link
Member

mik-laj commented Jun 11, 2020

Do you want to add something? I would like to merge this change, but it is a draft, so I can't do it.

@ephraimbuddy ephraimbuddy marked this pull request as ready for review June 11, 2020 15:48
@ephraimbuddy ephraimbuddy changed the title [WIP]Add readonly connection endpoints Add readonly connection endpoints Jun 11, 2020
@ephraimbuddy
Copy link
Contributor Author

You can merge it. I don't have anything to add again

@turbaszek turbaszek merged commit ecbb366 into apache:master Jun 11, 2020
@turbaszek
Copy link
Member

Thanks @ephraimbuddy !

@ephraimbuddy ephraimbuddy deleted the con-endpoints branch June 11, 2020 20:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:API Airflow's REST/HTTP API

Projects

None yet

Development

Successfully merging this pull request may close these issues.

API Endpoints - Read-only - Connection

4 participants