Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix ArcGIS import when there are no features #16322

Conversation

amiedes
Copy link
Contributor

@amiedes amiedes commented Jul 26, 2021

@shortcut-integration
Copy link

This pull request has been linked to Clubhouse Story #164052: [wnc] ArcGIS import fails due to timeout.

@amiedes amiedes force-pushed the feature/ch164052/wnc-arcgis-import-fails-due-to-timeout-amiedes-2 branch from 7fbe0b9 to 60a0eea Compare July 27, 2021 06:08
@amiedes
Copy link
Contributor Author

amiedes commented Jul 27, 2021

Acceptance in staging ✅

Import ArcGIS feature server without data

We import a feature server we know does not have data:

arcgis-import-11-pre

The import succeeds:

arcgis-import-11-post

And as a result creates an empty dataset:

arcgis-import-11-last

Import ArcGIS feature server with data

We select a feature server we know has data:

arcgis-import-2

And we can see the resulting rows after the import succeeds:

arcgis-import-2-lat

@@ -125,7 +125,15 @@ def run_import!
log.append("Running on server #{server} with PID: #{Process.pid}")

begin
success = !!dispatch
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is just a cleanup I did along the way, no behavior changes in this file

@@ -29,7 +29,7 @@ def @data_import.data_source=(filepath)
end

@data_import.data_source = file_name
@data_import.send :dispatch
@data_import.run_import!
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Better call the public API instead of a private method

@@ -123,6 +123,14 @@ def timed_log(s)
end
end

def build_empty_initial_stream
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is the key to the issue: I have to return an empty list of features in order for the dataset to be created with 0 rows

@amiedes amiedes requested a review from a team July 27, 2021 07:06
@amiedes amiedes marked this pull request as ready for review July 27, 2021 07:06
@amiedes amiedes requested review from Shylpx and removed request for a team July 27, 2021 07:07
Copy link
Collaborator

@Shylpx Shylpx left a comment

Choose a reason for hiding this comment

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

LGTM 🚀

@amiedes amiedes merged commit dc4b421 into master Jul 27, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants