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

Add namespace for merged datasets #223

Merged
merged 6 commits into from
Aug 3, 2017
Merged

Conversation

ivermac
Copy link
Contributor

@ivermac ivermac commented Jul 26, 2017

No description provided.

@ivermac ivermac requested a review from urbanslug July 26, 2017 06:11
(let [url (make-url "merged-datasets" (str merged-dataset-id ".json"))]
(parse-http :get url :no-cache? no-cache?)))

(defn ^:export data
Copy link
Contributor

@urbanslug urbanslug Jul 27, 2017

Choose a reason for hiding this comment

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

Hey I just have a small issue with the formatting and I think the code that builds dataset-suffix is a little too complicated.
I think #?@(:cljs [:or {:format "json"}]) is really cool. I didn't know that could be done 😄.

What do you think about:

(defn ^:export data
  "Return the data associated with a dataset."
  [merged-dataset-id & {:keys [format
                               raw?
                               must-revalidate?
                               accept-header
                               query-params
                               data-id]
                        #?@(:cljs [:or {:format "json"}])}]
  (let [dataset-suffix (when format (str data-id "." format))
        url            (make-url "merged-datasets"
                                 merged-dataset-id
                                 "data"
                                 dataset-suffix)
        options        {:query-params query-params}]
    (parse-http :get              url
                :http-options     options
                :raw-response?    raw?
                :must-revalidate? must-revalidate?
                :accept-header    accept-header)))

Copy link
Contributor

Choose a reason for hiding this comment

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

Ok I'm bikeshedding at this point but:

(defn ^:export data
  "Return the data associated with a dataset."
  [merged-dataset-id & {:keys [format
                               raw?
                               must-revalidate?
                               accept-header
                               query-params
                               data-id]
                        #?@(:cljs [:or {:format "json"}])}]
  (let [url     (make-url "merged-datasets"
                           merged-dataset-id
                           (when format (str "data" data-id "." format)))
        options {:query-params query-params}]
    (parse-http :get              url
                :http-options     options
                :raw-response?    raw?
                :must-revalidate? must-revalidate?
                :accept-header    accept-header)))

@ivermac ivermac force-pushed the add-namespace-for-merged-datasets branch from 6d2cc39 to 8cca6b5 Compare August 2, 2017 14:00
Signed-off-by: Njagi Mwaniki <njagi@urbanslug.com>
@ivermac ivermac merged commit e971c5a into master Aug 3, 2017
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.

3 participants